
obj/user/echo.debug:     file format elf32-i386


Disassembly of section .text:

00800020 <_start>:
// starts us running when we are initially loaded into a new environment.
.text
.globl _start
_start:
	// See if we were started with arguments on the stack
	cmpl $USTACKTOP, %esp
  800020:	81 fc 00 e0 bf ee    	cmp    $0xeebfe000,%esp
	jne args_exist
  800026:	75 04                	jne    80002c <args_exist>

	// If not, push dummy argc/argv arguments.
	// This happens when we are loaded by the kernel,
	// because the kernel does not know about passing arguments.
	pushl $0
  800028:	6a 00                	push   $0x0
	pushl $0
  80002a:	6a 00                	push   $0x0

0080002c <args_exist>:

args_exist:
	call libmain
  80002c:	e8 b7 00 00 00       	call   8000e8 <libmain>
1:	jmp 1b
  800031:	eb fe                	jmp    800031 <args_exist+0x5>

00800033 <umain>:
#include <inc/lib.h>

void
umain(int argc, char **argv)
{
  800033:	f3 0f 1e fb          	endbr32 
  800037:	55                   	push   %ebp
  800038:	89 e5                	mov    %esp,%ebp
  80003a:	57                   	push   %edi
  80003b:	56                   	push   %esi
  80003c:	53                   	push   %ebx
  80003d:	83 ec 1c             	sub    $0x1c,%esp
  800040:	8b 7d 08             	mov    0x8(%ebp),%edi
  800043:	8b 75 0c             	mov    0xc(%ebp),%esi
	int i, nflag;

	nflag = 0;
  800046:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
	if (argc > 1 && strcmp(argv[1], "-n") == 0) {
  80004d:	83 ff 01             	cmp    $0x1,%edi
  800050:	7f 07                	jg     800059 <umain+0x26>
		nflag = 1;
		argc--;
		argv++;
	}
	for (i = 1; i < argc; i++) {
  800052:	bb 01 00 00 00       	mov    $0x1,%ebx
  800057:	eb 60                	jmp    8000b9 <umain+0x86>
	if (argc > 1 && strcmp(argv[1], "-n") == 0) {
  800059:	83 ec 08             	sub    $0x8,%esp
  80005c:	68 80 1f 80 00       	push   $0x801f80
  800061:	ff 76 04             	pushl  0x4(%esi)
  800064:	e8 f3 01 00 00       	call   80025c <strcmp>
  800069:	83 c4 10             	add    $0x10,%esp
	nflag = 0;
  80006c:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
	if (argc > 1 && strcmp(argv[1], "-n") == 0) {
  800073:	85 c0                	test   %eax,%eax
  800075:	75 db                	jne    800052 <umain+0x1f>
		argc--;
  800077:	83 ef 01             	sub    $0x1,%edi
		argv++;
  80007a:	83 c6 04             	add    $0x4,%esi
		nflag = 1;
  80007d:	c7 45 e4 01 00 00 00 	movl   $0x1,-0x1c(%ebp)
  800084:	eb cc                	jmp    800052 <umain+0x1f>
		if (i > 1)
			write(1, " ", 1);
  800086:	83 ec 04             	sub    $0x4,%esp
  800089:	6a 01                	push   $0x1
  80008b:	68 83 1f 80 00       	push   $0x801f83
  800090:	6a 01                	push   $0x1
  800092:	e8 37 0b 00 00       	call   800bce <write>
  800097:	83 c4 10             	add    $0x10,%esp
		write(1, argv[i], strlen(argv[i]));
  80009a:	83 ec 0c             	sub    $0xc,%esp
  80009d:	ff 34 9e             	pushl  (%esi,%ebx,4)
  8000a0:	e8 b5 00 00 00       	call   80015a <strlen>
  8000a5:	83 c4 0c             	add    $0xc,%esp
  8000a8:	50                   	push   %eax
  8000a9:	ff 34 9e             	pushl  (%esi,%ebx,4)
  8000ac:	6a 01                	push   $0x1
  8000ae:	e8 1b 0b 00 00       	call   800bce <write>
	for (i = 1; i < argc; i++) {
  8000b3:	83 c3 01             	add    $0x1,%ebx
  8000b6:	83 c4 10             	add    $0x10,%esp
  8000b9:	39 df                	cmp    %ebx,%edi
  8000bb:	7e 07                	jle    8000c4 <umain+0x91>
		if (i > 1)
  8000bd:	83 fb 01             	cmp    $0x1,%ebx
  8000c0:	7f c4                	jg     800086 <umain+0x53>
  8000c2:	eb d6                	jmp    80009a <umain+0x67>
	}
	if (!nflag)
  8000c4:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
  8000c8:	74 08                	je     8000d2 <umain+0x9f>
		write(1, "\n", 1);
}
  8000ca:	8d 65 f4             	lea    -0xc(%ebp),%esp
  8000cd:	5b                   	pop    %ebx
  8000ce:	5e                   	pop    %esi
  8000cf:	5f                   	pop    %edi
  8000d0:	5d                   	pop    %ebp
  8000d1:	c3                   	ret    
		write(1, "\n", 1);
  8000d2:	83 ec 04             	sub    $0x4,%esp
  8000d5:	6a 01                	push   $0x1
  8000d7:	68 93 20 80 00       	push   $0x802093
  8000dc:	6a 01                	push   $0x1
  8000de:	e8 eb 0a 00 00       	call   800bce <write>
  8000e3:	83 c4 10             	add    $0x10,%esp
}
  8000e6:	eb e2                	jmp    8000ca <umain+0x97>

008000e8 <libmain>:
const volatile struct Env *thisenv;
const char *binaryname = "<unknown>";

void
libmain(int argc, char **argv)
{
  8000e8:	f3 0f 1e fb          	endbr32 
  8000ec:	55                   	push   %ebp
  8000ed:	89 e5                	mov    %esp,%ebp
  8000ef:	56                   	push   %esi
  8000f0:	53                   	push   %ebx
  8000f1:	8b 5d 08             	mov    0x8(%ebp),%ebx
  8000f4:	8b 75 0c             	mov    0xc(%ebp),%esi
	;    //系统调用，我们已经在Exercise 7中实现了
	
	
	
	//屏幕上打印出来了字母，但后续报错了，有意思，让我看看问题出现在哪。
	thisenv=0;
  8000f7:	c7 05 04 40 80 00 00 	movl   $0x0,0x804004
  8000fe:	00 00 00 
	thisenv = &envs[ENVX(sys_getenvid())];      //获取Env结构指针
  800101:	e8 93 04 00 00       	call   800599 <sys_getenvid>
  800106:	25 ff 03 00 00       	and    $0x3ff,%eax
  80010b:	6b c0 7c             	imul   $0x7c,%eax,%eax
  80010e:	05 00 00 c0 ee       	add    $0xeec00000,%eax
  800113:	a3 04 40 80 00       	mov    %eax,0x804004

	// save the name of the program so that panic() can use it
	if (argc > 0)
  800118:	85 db                	test   %ebx,%ebx
  80011a:	7e 07                	jle    800123 <libmain+0x3b>
		binaryname = argv[0];
  80011c:	8b 06                	mov    (%esi),%eax
  80011e:	a3 00 30 80 00       	mov    %eax,0x803000

	// call user main routine
	umain(argc, argv);
  800123:	83 ec 08             	sub    $0x8,%esp
  800126:	56                   	push   %esi
  800127:	53                   	push   %ebx
  800128:	e8 06 ff ff ff       	call   800033 <umain>

	// exit gracefully
	exit();
  80012d:	e8 0a 00 00 00       	call   80013c <exit>
}
  800132:	83 c4 10             	add    $0x10,%esp
  800135:	8d 65 f8             	lea    -0x8(%ebp),%esp
  800138:	5b                   	pop    %ebx
  800139:	5e                   	pop    %esi
  80013a:	5d                   	pop    %ebp
  80013b:	c3                   	ret    

0080013c <exit>:

#include <inc/lib.h>

void
exit(void)
{
  80013c:	f3 0f 1e fb          	endbr32 
  800140:	55                   	push   %ebp
  800141:	89 e5                	mov    %esp,%ebp
  800143:	83 ec 08             	sub    $0x8,%esp
	close_all();
  800146:	e8 94 08 00 00       	call   8009df <close_all>
	sys_env_destroy(0);
  80014b:	83 ec 0c             	sub    $0xc,%esp
  80014e:	6a 00                	push   $0x0
  800150:	e8 ff 03 00 00       	call   800554 <sys_env_destroy>
}
  800155:	83 c4 10             	add    $0x10,%esp
  800158:	c9                   	leave  
  800159:	c3                   	ret    

0080015a <strlen>:
// Primespipe runs 3x faster this way.
#define ASM 1

int
strlen(const char *s)
{
  80015a:	f3 0f 1e fb          	endbr32 
  80015e:	55                   	push   %ebp
  80015f:	89 e5                	mov    %esp,%ebp
  800161:	8b 55 08             	mov    0x8(%ebp),%edx
	int n;

	for (n = 0; *s != '\0'; s++)
  800164:	b8 00 00 00 00       	mov    $0x0,%eax
  800169:	80 3c 02 00          	cmpb   $0x0,(%edx,%eax,1)
  80016d:	74 05                	je     800174 <strlen+0x1a>
		n++;
  80016f:	83 c0 01             	add    $0x1,%eax
  800172:	eb f5                	jmp    800169 <strlen+0xf>
	return n;
}
  800174:	5d                   	pop    %ebp
  800175:	c3                   	ret    

00800176 <strnlen>:

int
strnlen(const char *s, size_t size)
{
  800176:	f3 0f 1e fb          	endbr32 
  80017a:	55                   	push   %ebp
  80017b:	89 e5                	mov    %esp,%ebp
  80017d:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800180:	8b 55 0c             	mov    0xc(%ebp),%edx
	int n;

	for (n = 0; size > 0 && *s != '\0'; s++, size--)
  800183:	b8 00 00 00 00       	mov    $0x0,%eax
  800188:	39 d0                	cmp    %edx,%eax
  80018a:	74 0d                	je     800199 <strnlen+0x23>
  80018c:	80 3c 01 00          	cmpb   $0x0,(%ecx,%eax,1)
  800190:	74 05                	je     800197 <strnlen+0x21>
		n++;
  800192:	83 c0 01             	add    $0x1,%eax
  800195:	eb f1                	jmp    800188 <strnlen+0x12>
  800197:	89 c2                	mov    %eax,%edx
	return n;
}
  800199:	89 d0                	mov    %edx,%eax
  80019b:	5d                   	pop    %ebp
  80019c:	c3                   	ret    

0080019d <strcpy>:

char *
strcpy(char *dst, const char *src)
{
  80019d:	f3 0f 1e fb          	endbr32 
  8001a1:	55                   	push   %ebp
  8001a2:	89 e5                	mov    %esp,%ebp
  8001a4:	53                   	push   %ebx
  8001a5:	8b 4d 08             	mov    0x8(%ebp),%ecx
  8001a8:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	char *ret;

	ret = dst;
	while ((*dst++ = *src++) != '\0')
  8001ab:	b8 00 00 00 00       	mov    $0x0,%eax
  8001b0:	0f b6 14 03          	movzbl (%ebx,%eax,1),%edx
  8001b4:	88 14 01             	mov    %dl,(%ecx,%eax,1)
  8001b7:	83 c0 01             	add    $0x1,%eax
  8001ba:	84 d2                	test   %dl,%dl
  8001bc:	75 f2                	jne    8001b0 <strcpy+0x13>
		/* do nothing */;
	return ret;
}
  8001be:	89 c8                	mov    %ecx,%eax
  8001c0:	5b                   	pop    %ebx
  8001c1:	5d                   	pop    %ebp
  8001c2:	c3                   	ret    

008001c3 <strcat>:

char *
strcat(char *dst, const char *src)
{
  8001c3:	f3 0f 1e fb          	endbr32 
  8001c7:	55                   	push   %ebp
  8001c8:	89 e5                	mov    %esp,%ebp
  8001ca:	53                   	push   %ebx
  8001cb:	83 ec 10             	sub    $0x10,%esp
  8001ce:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int len = strlen(dst);
  8001d1:	53                   	push   %ebx
  8001d2:	e8 83 ff ff ff       	call   80015a <strlen>
  8001d7:	83 c4 08             	add    $0x8,%esp
	strcpy(dst + len, src);
  8001da:	ff 75 0c             	pushl  0xc(%ebp)
  8001dd:	01 d8                	add    %ebx,%eax
  8001df:	50                   	push   %eax
  8001e0:	e8 b8 ff ff ff       	call   80019d <strcpy>
	return dst;
}
  8001e5:	89 d8                	mov    %ebx,%eax
  8001e7:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  8001ea:	c9                   	leave  
  8001eb:	c3                   	ret    

008001ec <strncpy>:

char *
strncpy(char *dst, const char *src, size_t size) {
  8001ec:	f3 0f 1e fb          	endbr32 
  8001f0:	55                   	push   %ebp
  8001f1:	89 e5                	mov    %esp,%ebp
  8001f3:	56                   	push   %esi
  8001f4:	53                   	push   %ebx
  8001f5:	8b 75 08             	mov    0x8(%ebp),%esi
  8001f8:	8b 55 0c             	mov    0xc(%ebp),%edx
  8001fb:	89 f3                	mov    %esi,%ebx
  8001fd:	03 5d 10             	add    0x10(%ebp),%ebx
	size_t i;
	char *ret;

	ret = dst;
	for (i = 0; i < size; i++) {
  800200:	89 f0                	mov    %esi,%eax
  800202:	39 d8                	cmp    %ebx,%eax
  800204:	74 11                	je     800217 <strncpy+0x2b>
		*dst++ = *src;
  800206:	83 c0 01             	add    $0x1,%eax
  800209:	0f b6 0a             	movzbl (%edx),%ecx
  80020c:	88 48 ff             	mov    %cl,-0x1(%eax)
		// If strlen(src) < size, null-pad 'dst' out to 'size' chars
		if (*src != '\0')
			src++;
  80020f:	80 f9 01             	cmp    $0x1,%cl
  800212:	83 da ff             	sbb    $0xffffffff,%edx
  800215:	eb eb                	jmp    800202 <strncpy+0x16>
	}
	return ret;
}
  800217:	89 f0                	mov    %esi,%eax
  800219:	5b                   	pop    %ebx
  80021a:	5e                   	pop    %esi
  80021b:	5d                   	pop    %ebp
  80021c:	c3                   	ret    

0080021d <strlcpy>:

size_t
strlcpy(char *dst, const char *src, size_t size)
{
  80021d:	f3 0f 1e fb          	endbr32 
  800221:	55                   	push   %ebp
  800222:	89 e5                	mov    %esp,%ebp
  800224:	56                   	push   %esi
  800225:	53                   	push   %ebx
  800226:	8b 75 08             	mov    0x8(%ebp),%esi
  800229:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  80022c:	8b 55 10             	mov    0x10(%ebp),%edx
  80022f:	89 f0                	mov    %esi,%eax
	char *dst_in;

	dst_in = dst;
	if (size > 0) {
  800231:	85 d2                	test   %edx,%edx
  800233:	74 21                	je     800256 <strlcpy+0x39>
  800235:	8d 44 16 ff          	lea    -0x1(%esi,%edx,1),%eax
  800239:	89 f2                	mov    %esi,%edx
		while (--size > 0 && *src != '\0')
  80023b:	39 c2                	cmp    %eax,%edx
  80023d:	74 14                	je     800253 <strlcpy+0x36>
  80023f:	0f b6 19             	movzbl (%ecx),%ebx
  800242:	84 db                	test   %bl,%bl
  800244:	74 0b                	je     800251 <strlcpy+0x34>
			*dst++ = *src++;
  800246:	83 c1 01             	add    $0x1,%ecx
  800249:	83 c2 01             	add    $0x1,%edx
  80024c:	88 5a ff             	mov    %bl,-0x1(%edx)
  80024f:	eb ea                	jmp    80023b <strlcpy+0x1e>
  800251:	89 d0                	mov    %edx,%eax
		*dst = '\0';
  800253:	c6 00 00             	movb   $0x0,(%eax)
	}
	return dst - dst_in;
  800256:	29 f0                	sub    %esi,%eax
}
  800258:	5b                   	pop    %ebx
  800259:	5e                   	pop    %esi
  80025a:	5d                   	pop    %ebp
  80025b:	c3                   	ret    

0080025c <strcmp>:

int
strcmp(const char *p, const char *q)
{
  80025c:	f3 0f 1e fb          	endbr32 
  800260:	55                   	push   %ebp
  800261:	89 e5                	mov    %esp,%ebp
  800263:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800266:	8b 55 0c             	mov    0xc(%ebp),%edx
	while (*p && *p == *q)
  800269:	0f b6 01             	movzbl (%ecx),%eax
  80026c:	84 c0                	test   %al,%al
  80026e:	74 0c                	je     80027c <strcmp+0x20>
  800270:	3a 02                	cmp    (%edx),%al
  800272:	75 08                	jne    80027c <strcmp+0x20>
		p++, q++;
  800274:	83 c1 01             	add    $0x1,%ecx
  800277:	83 c2 01             	add    $0x1,%edx
  80027a:	eb ed                	jmp    800269 <strcmp+0xd>
	return (int) ((unsigned char) *p - (unsigned char) *q);
  80027c:	0f b6 c0             	movzbl %al,%eax
  80027f:	0f b6 12             	movzbl (%edx),%edx
  800282:	29 d0                	sub    %edx,%eax
}
  800284:	5d                   	pop    %ebp
  800285:	c3                   	ret    

00800286 <strncmp>:

int
strncmp(const char *p, const char *q, size_t n)
{
  800286:	f3 0f 1e fb          	endbr32 
  80028a:	55                   	push   %ebp
  80028b:	89 e5                	mov    %esp,%ebp
  80028d:	53                   	push   %ebx
  80028e:	8b 45 08             	mov    0x8(%ebp),%eax
  800291:	8b 55 0c             	mov    0xc(%ebp),%edx
  800294:	89 c3                	mov    %eax,%ebx
  800296:	03 5d 10             	add    0x10(%ebp),%ebx
	while (n > 0 && *p && *p == *q)
  800299:	eb 06                	jmp    8002a1 <strncmp+0x1b>
		n--, p++, q++;
  80029b:	83 c0 01             	add    $0x1,%eax
  80029e:	83 c2 01             	add    $0x1,%edx
	while (n > 0 && *p && *p == *q)
  8002a1:	39 d8                	cmp    %ebx,%eax
  8002a3:	74 16                	je     8002bb <strncmp+0x35>
  8002a5:	0f b6 08             	movzbl (%eax),%ecx
  8002a8:	84 c9                	test   %cl,%cl
  8002aa:	74 04                	je     8002b0 <strncmp+0x2a>
  8002ac:	3a 0a                	cmp    (%edx),%cl
  8002ae:	74 eb                	je     80029b <strncmp+0x15>
	if (n == 0)
		return 0;
	else
		return (int) ((unsigned char) *p - (unsigned char) *q);
  8002b0:	0f b6 00             	movzbl (%eax),%eax
  8002b3:	0f b6 12             	movzbl (%edx),%edx
  8002b6:	29 d0                	sub    %edx,%eax
}
  8002b8:	5b                   	pop    %ebx
  8002b9:	5d                   	pop    %ebp
  8002ba:	c3                   	ret    
		return 0;
  8002bb:	b8 00 00 00 00       	mov    $0x0,%eax
  8002c0:	eb f6                	jmp    8002b8 <strncmp+0x32>

008002c2 <strchr>:

// Return a pointer to the first occurrence of 'c' in 's',
// or a null pointer if the string has no 'c'.
char *
strchr(const char *s, char c)
{
  8002c2:	f3 0f 1e fb          	endbr32 
  8002c6:	55                   	push   %ebp
  8002c7:	89 e5                	mov    %esp,%ebp
  8002c9:	8b 45 08             	mov    0x8(%ebp),%eax
  8002cc:	0f b6 4d 0c          	movzbl 0xc(%ebp),%ecx
	for (; *s; s++)
  8002d0:	0f b6 10             	movzbl (%eax),%edx
  8002d3:	84 d2                	test   %dl,%dl
  8002d5:	74 09                	je     8002e0 <strchr+0x1e>
		if (*s == c)
  8002d7:	38 ca                	cmp    %cl,%dl
  8002d9:	74 0a                	je     8002e5 <strchr+0x23>
	for (; *s; s++)
  8002db:	83 c0 01             	add    $0x1,%eax
  8002de:	eb f0                	jmp    8002d0 <strchr+0xe>
			return (char *) s;
	return 0;
  8002e0:	b8 00 00 00 00       	mov    $0x0,%eax
}
  8002e5:	5d                   	pop    %ebp
  8002e6:	c3                   	ret    

008002e7 <strfind>:

// Return a pointer to the first occurrence of 'c' in 's',
// or a pointer to the string-ending null character if the string has no 'c'.
char *
strfind(const char *s, char c)
{
  8002e7:	f3 0f 1e fb          	endbr32 
  8002eb:	55                   	push   %ebp
  8002ec:	89 e5                	mov    %esp,%ebp
  8002ee:	8b 45 08             	mov    0x8(%ebp),%eax
  8002f1:	0f b6 4d 0c          	movzbl 0xc(%ebp),%ecx
	for (; *s; s++)
  8002f5:	0f b6 10             	movzbl (%eax),%edx
		if (*s == c)
  8002f8:	38 ca                	cmp    %cl,%dl
  8002fa:	74 09                	je     800305 <strfind+0x1e>
  8002fc:	84 d2                	test   %dl,%dl
  8002fe:	74 05                	je     800305 <strfind+0x1e>
	for (; *s; s++)
  800300:	83 c0 01             	add    $0x1,%eax
  800303:	eb f0                	jmp    8002f5 <strfind+0xe>
			break;
	return (char *) s;
}
  800305:	5d                   	pop    %ebp
  800306:	c3                   	ret    

00800307 <memset>:

#if ASM
void *
memset(void *v, int c, size_t n)
{
  800307:	f3 0f 1e fb          	endbr32 
  80030b:	55                   	push   %ebp
  80030c:	89 e5                	mov    %esp,%ebp
  80030e:	57                   	push   %edi
  80030f:	56                   	push   %esi
  800310:	53                   	push   %ebx
  800311:	8b 7d 08             	mov    0x8(%ebp),%edi
  800314:	8b 4d 10             	mov    0x10(%ebp),%ecx
	char *p;

	if (n == 0)
  800317:	85 c9                	test   %ecx,%ecx
  800319:	74 31                	je     80034c <memset+0x45>
		return v;
	if ((int)v%4 == 0 && n%4 == 0) {
  80031b:	89 f8                	mov    %edi,%eax
  80031d:	09 c8                	or     %ecx,%eax
  80031f:	a8 03                	test   $0x3,%al
  800321:	75 23                	jne    800346 <memset+0x3f>
		c &= 0xFF;
  800323:	0f b6 55 0c          	movzbl 0xc(%ebp),%edx
		c = (c<<24)|(c<<16)|(c<<8)|c;
  800327:	89 d3                	mov    %edx,%ebx
  800329:	c1 e3 08             	shl    $0x8,%ebx
  80032c:	89 d0                	mov    %edx,%eax
  80032e:	c1 e0 18             	shl    $0x18,%eax
  800331:	89 d6                	mov    %edx,%esi
  800333:	c1 e6 10             	shl    $0x10,%esi
  800336:	09 f0                	or     %esi,%eax
  800338:	09 c2                	or     %eax,%edx
  80033a:	09 da                	or     %ebx,%edx
		asm volatile("cld; rep stosl\n"
			:: "D" (v), "a" (c), "c" (n/4)
  80033c:	c1 e9 02             	shr    $0x2,%ecx
		asm volatile("cld; rep stosl\n"
  80033f:	89 d0                	mov    %edx,%eax
  800341:	fc                   	cld    
  800342:	f3 ab                	rep stos %eax,%es:(%edi)
  800344:	eb 06                	jmp    80034c <memset+0x45>
			: "cc", "memory");
	} else
		asm volatile("cld; rep stosb\n"
  800346:	8b 45 0c             	mov    0xc(%ebp),%eax
  800349:	fc                   	cld    
  80034a:	f3 aa                	rep stos %al,%es:(%edi)
			:: "D" (v), "a" (c), "c" (n)
			: "cc", "memory");
	return v;
}
  80034c:	89 f8                	mov    %edi,%eax
  80034e:	5b                   	pop    %ebx
  80034f:	5e                   	pop    %esi
  800350:	5f                   	pop    %edi
  800351:	5d                   	pop    %ebp
  800352:	c3                   	ret    

00800353 <memmove>:

void *
memmove(void *dst, const void *src, size_t n)
{
  800353:	f3 0f 1e fb          	endbr32 
  800357:	55                   	push   %ebp
  800358:	89 e5                	mov    %esp,%ebp
  80035a:	57                   	push   %edi
  80035b:	56                   	push   %esi
  80035c:	8b 45 08             	mov    0x8(%ebp),%eax
  80035f:	8b 75 0c             	mov    0xc(%ebp),%esi
  800362:	8b 4d 10             	mov    0x10(%ebp),%ecx
	const char *s;
	char *d;

	s = src;
	d = dst;
	if (s < d && s + n > d) {
  800365:	39 c6                	cmp    %eax,%esi
  800367:	73 32                	jae    80039b <memmove+0x48>
  800369:	8d 14 0e             	lea    (%esi,%ecx,1),%edx
  80036c:	39 c2                	cmp    %eax,%edx
  80036e:	76 2b                	jbe    80039b <memmove+0x48>
		s += n;
		d += n;
  800370:	8d 3c 08             	lea    (%eax,%ecx,1),%edi
		if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0)
  800373:	89 fe                	mov    %edi,%esi
  800375:	09 ce                	or     %ecx,%esi
  800377:	09 d6                	or     %edx,%esi
  800379:	f7 c6 03 00 00 00    	test   $0x3,%esi
  80037f:	75 0e                	jne    80038f <memmove+0x3c>
			asm volatile("std; rep movsl\n"
				:: "D" (d-4), "S" (s-4), "c" (n/4) : "cc", "memory");
  800381:	83 ef 04             	sub    $0x4,%edi
  800384:	8d 72 fc             	lea    -0x4(%edx),%esi
  800387:	c1 e9 02             	shr    $0x2,%ecx
			asm volatile("std; rep movsl\n"
  80038a:	fd                   	std    
  80038b:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
  80038d:	eb 09                	jmp    800398 <memmove+0x45>
		else
			asm volatile("std; rep movsb\n"
				:: "D" (d-1), "S" (s-1), "c" (n) : "cc", "memory");
  80038f:	83 ef 01             	sub    $0x1,%edi
  800392:	8d 72 ff             	lea    -0x1(%edx),%esi
			asm volatile("std; rep movsb\n"
  800395:	fd                   	std    
  800396:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
		// Some versions of GCC rely on DF being clear
		asm volatile("cld" ::: "cc");
  800398:	fc                   	cld    
  800399:	eb 1a                	jmp    8003b5 <memmove+0x62>
	} else {
		if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0)
  80039b:	89 c2                	mov    %eax,%edx
  80039d:	09 ca                	or     %ecx,%edx
  80039f:	09 f2                	or     %esi,%edx
  8003a1:	f6 c2 03             	test   $0x3,%dl
  8003a4:	75 0a                	jne    8003b0 <memmove+0x5d>
			asm volatile("cld; rep movsl\n"
				:: "D" (d), "S" (s), "c" (n/4) : "cc", "memory");
  8003a6:	c1 e9 02             	shr    $0x2,%ecx
			asm volatile("cld; rep movsl\n"
  8003a9:	89 c7                	mov    %eax,%edi
  8003ab:	fc                   	cld    
  8003ac:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
  8003ae:	eb 05                	jmp    8003b5 <memmove+0x62>
		else
			asm volatile("cld; rep movsb\n"
  8003b0:	89 c7                	mov    %eax,%edi
  8003b2:	fc                   	cld    
  8003b3:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
				:: "D" (d), "S" (s), "c" (n) : "cc", "memory");
	}
	return dst;
}
  8003b5:	5e                   	pop    %esi
  8003b6:	5f                   	pop    %edi
  8003b7:	5d                   	pop    %ebp
  8003b8:	c3                   	ret    

008003b9 <memcpy>:
}
#endif

void *
memcpy(void *dst, const void *src, size_t n)
{
  8003b9:	f3 0f 1e fb          	endbr32 
  8003bd:	55                   	push   %ebp
  8003be:	89 e5                	mov    %esp,%ebp
  8003c0:	83 ec 0c             	sub    $0xc,%esp
	return memmove(dst, src, n);
  8003c3:	ff 75 10             	pushl  0x10(%ebp)
  8003c6:	ff 75 0c             	pushl  0xc(%ebp)
  8003c9:	ff 75 08             	pushl  0x8(%ebp)
  8003cc:	e8 82 ff ff ff       	call   800353 <memmove>
}
  8003d1:	c9                   	leave  
  8003d2:	c3                   	ret    

008003d3 <memcmp>:

int
memcmp(const void *v1, const void *v2, size_t n)
{
  8003d3:	f3 0f 1e fb          	endbr32 
  8003d7:	55                   	push   %ebp
  8003d8:	89 e5                	mov    %esp,%ebp
  8003da:	56                   	push   %esi
  8003db:	53                   	push   %ebx
  8003dc:	8b 45 08             	mov    0x8(%ebp),%eax
  8003df:	8b 55 0c             	mov    0xc(%ebp),%edx
  8003e2:	89 c6                	mov    %eax,%esi
  8003e4:	03 75 10             	add    0x10(%ebp),%esi
	const uint8_t *s1 = (const uint8_t *) v1;
	const uint8_t *s2 = (const uint8_t *) v2;

	while (n-- > 0) {
  8003e7:	39 f0                	cmp    %esi,%eax
  8003e9:	74 1c                	je     800407 <memcmp+0x34>
		if (*s1 != *s2)
  8003eb:	0f b6 08             	movzbl (%eax),%ecx
  8003ee:	0f b6 1a             	movzbl (%edx),%ebx
  8003f1:	38 d9                	cmp    %bl,%cl
  8003f3:	75 08                	jne    8003fd <memcmp+0x2a>
			return (int) *s1 - (int) *s2;
		s1++, s2++;
  8003f5:	83 c0 01             	add    $0x1,%eax
  8003f8:	83 c2 01             	add    $0x1,%edx
  8003fb:	eb ea                	jmp    8003e7 <memcmp+0x14>
			return (int) *s1 - (int) *s2;
  8003fd:	0f b6 c1             	movzbl %cl,%eax
  800400:	0f b6 db             	movzbl %bl,%ebx
  800403:	29 d8                	sub    %ebx,%eax
  800405:	eb 05                	jmp    80040c <memcmp+0x39>
	}

	return 0;
  800407:	b8 00 00 00 00       	mov    $0x0,%eax
}
  80040c:	5b                   	pop    %ebx
  80040d:	5e                   	pop    %esi
  80040e:	5d                   	pop    %ebp
  80040f:	c3                   	ret    

00800410 <memfind>:

void *
memfind(const void *s, int c, size_t n)
{
  800410:	f3 0f 1e fb          	endbr32 
  800414:	55                   	push   %ebp
  800415:	89 e5                	mov    %esp,%ebp
  800417:	8b 45 08             	mov    0x8(%ebp),%eax
  80041a:	8b 4d 0c             	mov    0xc(%ebp),%ecx
	const void *ends = (const char *) s + n;
  80041d:	89 c2                	mov    %eax,%edx
  80041f:	03 55 10             	add    0x10(%ebp),%edx
	for (; s < ends; s++)
  800422:	39 d0                	cmp    %edx,%eax
  800424:	73 09                	jae    80042f <memfind+0x1f>
		if (*(const unsigned char *) s == (unsigned char) c)
  800426:	38 08                	cmp    %cl,(%eax)
  800428:	74 05                	je     80042f <memfind+0x1f>
	for (; s < ends; s++)
  80042a:	83 c0 01             	add    $0x1,%eax
  80042d:	eb f3                	jmp    800422 <memfind+0x12>
			break;
	return (void *) s;
}
  80042f:	5d                   	pop    %ebp
  800430:	c3                   	ret    

00800431 <strtol>:

long
strtol(const char *s, char **endptr, int base)
{
  800431:	f3 0f 1e fb          	endbr32 
  800435:	55                   	push   %ebp
  800436:	89 e5                	mov    %esp,%ebp
  800438:	57                   	push   %edi
  800439:	56                   	push   %esi
  80043a:	53                   	push   %ebx
  80043b:	8b 4d 08             	mov    0x8(%ebp),%ecx
  80043e:	8b 5d 10             	mov    0x10(%ebp),%ebx
	int neg = 0;
	long val = 0;

	// gobble initial whitespace
	while (*s == ' ' || *s == '\t')
  800441:	eb 03                	jmp    800446 <strtol+0x15>
		s++;
  800443:	83 c1 01             	add    $0x1,%ecx
	while (*s == ' ' || *s == '\t')
  800446:	0f b6 01             	movzbl (%ecx),%eax
  800449:	3c 20                	cmp    $0x20,%al
  80044b:	74 f6                	je     800443 <strtol+0x12>
  80044d:	3c 09                	cmp    $0x9,%al
  80044f:	74 f2                	je     800443 <strtol+0x12>

	// plus/minus sign
	if (*s == '+')
  800451:	3c 2b                	cmp    $0x2b,%al
  800453:	74 2a                	je     80047f <strtol+0x4e>
	int neg = 0;
  800455:	bf 00 00 00 00       	mov    $0x0,%edi
		s++;
	else if (*s == '-')
  80045a:	3c 2d                	cmp    $0x2d,%al
  80045c:	74 2b                	je     800489 <strtol+0x58>
		s++, neg = 1;

	// hex or octal base prefix
	if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x'))
  80045e:	f7 c3 ef ff ff ff    	test   $0xffffffef,%ebx
  800464:	75 0f                	jne    800475 <strtol+0x44>
  800466:	80 39 30             	cmpb   $0x30,(%ecx)
  800469:	74 28                	je     800493 <strtol+0x62>
		s += 2, base = 16;
	else if (base == 0 && s[0] == '0')
		s++, base = 8;
	else if (base == 0)
		base = 10;
  80046b:	85 db                	test   %ebx,%ebx
  80046d:	b8 0a 00 00 00       	mov    $0xa,%eax
  800472:	0f 44 d8             	cmove  %eax,%ebx
  800475:	b8 00 00 00 00       	mov    $0x0,%eax
  80047a:	89 5d 10             	mov    %ebx,0x10(%ebp)
  80047d:	eb 46                	jmp    8004c5 <strtol+0x94>
		s++;
  80047f:	83 c1 01             	add    $0x1,%ecx
	int neg = 0;
  800482:	bf 00 00 00 00       	mov    $0x0,%edi
  800487:	eb d5                	jmp    80045e <strtol+0x2d>
		s++, neg = 1;
  800489:	83 c1 01             	add    $0x1,%ecx
  80048c:	bf 01 00 00 00       	mov    $0x1,%edi
  800491:	eb cb                	jmp    80045e <strtol+0x2d>
	if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x'))
  800493:	80 79 01 78          	cmpb   $0x78,0x1(%ecx)
  800497:	74 0e                	je     8004a7 <strtol+0x76>
	else if (base == 0 && s[0] == '0')
  800499:	85 db                	test   %ebx,%ebx
  80049b:	75 d8                	jne    800475 <strtol+0x44>
		s++, base = 8;
  80049d:	83 c1 01             	add    $0x1,%ecx
  8004a0:	bb 08 00 00 00       	mov    $0x8,%ebx
  8004a5:	eb ce                	jmp    800475 <strtol+0x44>
		s += 2, base = 16;
  8004a7:	83 c1 02             	add    $0x2,%ecx
  8004aa:	bb 10 00 00 00       	mov    $0x10,%ebx
  8004af:	eb c4                	jmp    800475 <strtol+0x44>
	// digits
	while (1) {
		int dig;

		if (*s >= '0' && *s <= '9')
			dig = *s - '0';
  8004b1:	0f be d2             	movsbl %dl,%edx
  8004b4:	83 ea 30             	sub    $0x30,%edx
			dig = *s - 'a' + 10;
		else if (*s >= 'A' && *s <= 'Z')
			dig = *s - 'A' + 10;
		else
			break;
		if (dig >= base)
  8004b7:	3b 55 10             	cmp    0x10(%ebp),%edx
  8004ba:	7d 3a                	jge    8004f6 <strtol+0xc5>
			break;
		s++, val = (val * base) + dig;
  8004bc:	83 c1 01             	add    $0x1,%ecx
  8004bf:	0f af 45 10          	imul   0x10(%ebp),%eax
  8004c3:	01 d0                	add    %edx,%eax
		if (*s >= '0' && *s <= '9')
  8004c5:	0f b6 11             	movzbl (%ecx),%edx
  8004c8:	8d 72 d0             	lea    -0x30(%edx),%esi
  8004cb:	89 f3                	mov    %esi,%ebx
  8004cd:	80 fb 09             	cmp    $0x9,%bl
  8004d0:	76 df                	jbe    8004b1 <strtol+0x80>
		else if (*s >= 'a' && *s <= 'z')
  8004d2:	8d 72 9f             	lea    -0x61(%edx),%esi
  8004d5:	89 f3                	mov    %esi,%ebx
  8004d7:	80 fb 19             	cmp    $0x19,%bl
  8004da:	77 08                	ja     8004e4 <strtol+0xb3>
			dig = *s - 'a' + 10;
  8004dc:	0f be d2             	movsbl %dl,%edx
  8004df:	83 ea 57             	sub    $0x57,%edx
  8004e2:	eb d3                	jmp    8004b7 <strtol+0x86>
		else if (*s >= 'A' && *s <= 'Z')
  8004e4:	8d 72 bf             	lea    -0x41(%edx),%esi
  8004e7:	89 f3                	mov    %esi,%ebx
  8004e9:	80 fb 19             	cmp    $0x19,%bl
  8004ec:	77 08                	ja     8004f6 <strtol+0xc5>
			dig = *s - 'A' + 10;
  8004ee:	0f be d2             	movsbl %dl,%edx
  8004f1:	83 ea 37             	sub    $0x37,%edx
  8004f4:	eb c1                	jmp    8004b7 <strtol+0x86>
		// we don't properly detect overflow!
	}

	if (endptr)
  8004f6:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
  8004fa:	74 05                	je     800501 <strtol+0xd0>
		*endptr = (char *) s;
  8004fc:	8b 75 0c             	mov    0xc(%ebp),%esi
  8004ff:	89 0e                	mov    %ecx,(%esi)
	return (neg ? -val : val);
  800501:	89 c2                	mov    %eax,%edx
  800503:	f7 da                	neg    %edx
  800505:	85 ff                	test   %edi,%edi
  800507:	0f 45 c2             	cmovne %edx,%eax
}
  80050a:	5b                   	pop    %ebx
  80050b:	5e                   	pop    %esi
  80050c:	5f                   	pop    %edi
  80050d:	5d                   	pop    %ebp
  80050e:	c3                   	ret    

0080050f <sys_cputs>:
	return ret;
}

void
sys_cputs(const char *s, size_t len)
{
  80050f:	f3 0f 1e fb          	endbr32 
  800513:	55                   	push   %ebp
  800514:	89 e5                	mov    %esp,%ebp
  800516:	57                   	push   %edi
  800517:	56                   	push   %esi
  800518:	53                   	push   %ebx
	asm volatile("int %1\n"
  800519:	b8 00 00 00 00       	mov    $0x0,%eax
  80051e:	8b 55 08             	mov    0x8(%ebp),%edx
  800521:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800524:	89 c3                	mov    %eax,%ebx
  800526:	89 c7                	mov    %eax,%edi
  800528:	89 c6                	mov    %eax,%esi
  80052a:	cd 30                	int    $0x30
	syscall(SYS_cputs, 0, (uint32_t)s, len, 0, 0, 0);
}
  80052c:	5b                   	pop    %ebx
  80052d:	5e                   	pop    %esi
  80052e:	5f                   	pop    %edi
  80052f:	5d                   	pop    %ebp
  800530:	c3                   	ret    

00800531 <sys_cgetc>:

int
sys_cgetc(void)
{
  800531:	f3 0f 1e fb          	endbr32 
  800535:	55                   	push   %ebp
  800536:	89 e5                	mov    %esp,%ebp
  800538:	57                   	push   %edi
  800539:	56                   	push   %esi
  80053a:	53                   	push   %ebx
	asm volatile("int %1\n"
  80053b:	ba 00 00 00 00       	mov    $0x0,%edx
  800540:	b8 01 00 00 00       	mov    $0x1,%eax
  800545:	89 d1                	mov    %edx,%ecx
  800547:	89 d3                	mov    %edx,%ebx
  800549:	89 d7                	mov    %edx,%edi
  80054b:	89 d6                	mov    %edx,%esi
  80054d:	cd 30                	int    $0x30
	return syscall(SYS_cgetc, 0, 0, 0, 0, 0, 0);
}
  80054f:	5b                   	pop    %ebx
  800550:	5e                   	pop    %esi
  800551:	5f                   	pop    %edi
  800552:	5d                   	pop    %ebp
  800553:	c3                   	ret    

00800554 <sys_env_destroy>:

int
sys_env_destroy(envid_t envid)
{
  800554:	f3 0f 1e fb          	endbr32 
  800558:	55                   	push   %ebp
  800559:	89 e5                	mov    %esp,%ebp
  80055b:	57                   	push   %edi
  80055c:	56                   	push   %esi
  80055d:	53                   	push   %ebx
  80055e:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800561:	b9 00 00 00 00       	mov    $0x0,%ecx
  800566:	8b 55 08             	mov    0x8(%ebp),%edx
  800569:	b8 03 00 00 00       	mov    $0x3,%eax
  80056e:	89 cb                	mov    %ecx,%ebx
  800570:	89 cf                	mov    %ecx,%edi
  800572:	89 ce                	mov    %ecx,%esi
  800574:	cd 30                	int    $0x30
	if(check && ret > 0)
  800576:	85 c0                	test   %eax,%eax
  800578:	7f 08                	jg     800582 <sys_env_destroy+0x2e>
	return syscall(SYS_env_destroy, 1, envid, 0, 0, 0, 0);
}
  80057a:	8d 65 f4             	lea    -0xc(%ebp),%esp
  80057d:	5b                   	pop    %ebx
  80057e:	5e                   	pop    %esi
  80057f:	5f                   	pop    %edi
  800580:	5d                   	pop    %ebp
  800581:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800582:	83 ec 0c             	sub    $0xc,%esp
  800585:	50                   	push   %eax
  800586:	6a 03                	push   $0x3
  800588:	68 8f 1f 80 00       	push   $0x801f8f
  80058d:	6a 23                	push   $0x23
  80058f:	68 ac 1f 80 00       	push   $0x801fac
  800594:	e8 9c 0f 00 00       	call   801535 <_panic>

00800599 <sys_getenvid>:

envid_t
sys_getenvid(void)
{
  800599:	f3 0f 1e fb          	endbr32 
  80059d:	55                   	push   %ebp
  80059e:	89 e5                	mov    %esp,%ebp
  8005a0:	57                   	push   %edi
  8005a1:	56                   	push   %esi
  8005a2:	53                   	push   %ebx
	asm volatile("int %1\n"
  8005a3:	ba 00 00 00 00       	mov    $0x0,%edx
  8005a8:	b8 02 00 00 00       	mov    $0x2,%eax
  8005ad:	89 d1                	mov    %edx,%ecx
  8005af:	89 d3                	mov    %edx,%ebx
  8005b1:	89 d7                	mov    %edx,%edi
  8005b3:	89 d6                	mov    %edx,%esi
  8005b5:	cd 30                	int    $0x30
	 return syscall(SYS_getenvid, 0, 0, 0, 0, 0, 0);
}
  8005b7:	5b                   	pop    %ebx
  8005b8:	5e                   	pop    %esi
  8005b9:	5f                   	pop    %edi
  8005ba:	5d                   	pop    %ebp
  8005bb:	c3                   	ret    

008005bc <sys_yield>:

void
sys_yield(void)
{
  8005bc:	f3 0f 1e fb          	endbr32 
  8005c0:	55                   	push   %ebp
  8005c1:	89 e5                	mov    %esp,%ebp
  8005c3:	57                   	push   %edi
  8005c4:	56                   	push   %esi
  8005c5:	53                   	push   %ebx
	asm volatile("int %1\n"
  8005c6:	ba 00 00 00 00       	mov    $0x0,%edx
  8005cb:	b8 0b 00 00 00       	mov    $0xb,%eax
  8005d0:	89 d1                	mov    %edx,%ecx
  8005d2:	89 d3                	mov    %edx,%ebx
  8005d4:	89 d7                	mov    %edx,%edi
  8005d6:	89 d6                	mov    %edx,%esi
  8005d8:	cd 30                	int    $0x30
	syscall(SYS_yield, 0, 0, 0, 0, 0, 0);
}
  8005da:	5b                   	pop    %ebx
  8005db:	5e                   	pop    %esi
  8005dc:	5f                   	pop    %edi
  8005dd:	5d                   	pop    %ebp
  8005de:	c3                   	ret    

008005df <sys_page_alloc>:

int
sys_page_alloc(envid_t envid, void *va, int perm)
{
  8005df:	f3 0f 1e fb          	endbr32 
  8005e3:	55                   	push   %ebp
  8005e4:	89 e5                	mov    %esp,%ebp
  8005e6:	57                   	push   %edi
  8005e7:	56                   	push   %esi
  8005e8:	53                   	push   %ebx
  8005e9:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  8005ec:	be 00 00 00 00       	mov    $0x0,%esi
  8005f1:	8b 55 08             	mov    0x8(%ebp),%edx
  8005f4:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  8005f7:	b8 04 00 00 00       	mov    $0x4,%eax
  8005fc:	8b 5d 10             	mov    0x10(%ebp),%ebx
  8005ff:	89 f7                	mov    %esi,%edi
  800601:	cd 30                	int    $0x30
	if(check && ret > 0)
  800603:	85 c0                	test   %eax,%eax
  800605:	7f 08                	jg     80060f <sys_page_alloc+0x30>
	return syscall(SYS_page_alloc, 1, envid, (uint32_t) va, perm, 0, 0);
}
  800607:	8d 65 f4             	lea    -0xc(%ebp),%esp
  80060a:	5b                   	pop    %ebx
  80060b:	5e                   	pop    %esi
  80060c:	5f                   	pop    %edi
  80060d:	5d                   	pop    %ebp
  80060e:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  80060f:	83 ec 0c             	sub    $0xc,%esp
  800612:	50                   	push   %eax
  800613:	6a 04                	push   $0x4
  800615:	68 8f 1f 80 00       	push   $0x801f8f
  80061a:	6a 23                	push   $0x23
  80061c:	68 ac 1f 80 00       	push   $0x801fac
  800621:	e8 0f 0f 00 00       	call   801535 <_panic>

00800626 <sys_page_map>:

int
sys_page_map(envid_t srcenv, void *srcva, envid_t dstenv, void *dstva, int perm)
{
  800626:	f3 0f 1e fb          	endbr32 
  80062a:	55                   	push   %ebp
  80062b:	89 e5                	mov    %esp,%ebp
  80062d:	57                   	push   %edi
  80062e:	56                   	push   %esi
  80062f:	53                   	push   %ebx
  800630:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800633:	8b 55 08             	mov    0x8(%ebp),%edx
  800636:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800639:	b8 05 00 00 00       	mov    $0x5,%eax
  80063e:	8b 5d 10             	mov    0x10(%ebp),%ebx
  800641:	8b 7d 14             	mov    0x14(%ebp),%edi
  800644:	8b 75 18             	mov    0x18(%ebp),%esi
  800647:	cd 30                	int    $0x30
	if(check && ret > 0)
  800649:	85 c0                	test   %eax,%eax
  80064b:	7f 08                	jg     800655 <sys_page_map+0x2f>
	return syscall(SYS_page_map, 1, srcenv, (uint32_t) srcva, dstenv, (uint32_t) dstva, perm);
}
  80064d:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800650:	5b                   	pop    %ebx
  800651:	5e                   	pop    %esi
  800652:	5f                   	pop    %edi
  800653:	5d                   	pop    %ebp
  800654:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800655:	83 ec 0c             	sub    $0xc,%esp
  800658:	50                   	push   %eax
  800659:	6a 05                	push   $0x5
  80065b:	68 8f 1f 80 00       	push   $0x801f8f
  800660:	6a 23                	push   $0x23
  800662:	68 ac 1f 80 00       	push   $0x801fac
  800667:	e8 c9 0e 00 00       	call   801535 <_panic>

0080066c <sys_page_unmap>:

int
sys_page_unmap(envid_t envid, void *va)
{
  80066c:	f3 0f 1e fb          	endbr32 
  800670:	55                   	push   %ebp
  800671:	89 e5                	mov    %esp,%ebp
  800673:	57                   	push   %edi
  800674:	56                   	push   %esi
  800675:	53                   	push   %ebx
  800676:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800679:	bb 00 00 00 00       	mov    $0x0,%ebx
  80067e:	8b 55 08             	mov    0x8(%ebp),%edx
  800681:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800684:	b8 06 00 00 00       	mov    $0x6,%eax
  800689:	89 df                	mov    %ebx,%edi
  80068b:	89 de                	mov    %ebx,%esi
  80068d:	cd 30                	int    $0x30
	if(check && ret > 0)
  80068f:	85 c0                	test   %eax,%eax
  800691:	7f 08                	jg     80069b <sys_page_unmap+0x2f>
	return syscall(SYS_page_unmap, 1, envid, (uint32_t) va, 0, 0, 0);
}
  800693:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800696:	5b                   	pop    %ebx
  800697:	5e                   	pop    %esi
  800698:	5f                   	pop    %edi
  800699:	5d                   	pop    %ebp
  80069a:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  80069b:	83 ec 0c             	sub    $0xc,%esp
  80069e:	50                   	push   %eax
  80069f:	6a 06                	push   $0x6
  8006a1:	68 8f 1f 80 00       	push   $0x801f8f
  8006a6:	6a 23                	push   $0x23
  8006a8:	68 ac 1f 80 00       	push   $0x801fac
  8006ad:	e8 83 0e 00 00       	call   801535 <_panic>

008006b2 <sys_env_set_status>:

// sys_exofork is inlined in lib.h

int
sys_env_set_status(envid_t envid, int status)
{
  8006b2:	f3 0f 1e fb          	endbr32 
  8006b6:	55                   	push   %ebp
  8006b7:	89 e5                	mov    %esp,%ebp
  8006b9:	57                   	push   %edi
  8006ba:	56                   	push   %esi
  8006bb:	53                   	push   %ebx
  8006bc:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  8006bf:	bb 00 00 00 00       	mov    $0x0,%ebx
  8006c4:	8b 55 08             	mov    0x8(%ebp),%edx
  8006c7:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  8006ca:	b8 08 00 00 00       	mov    $0x8,%eax
  8006cf:	89 df                	mov    %ebx,%edi
  8006d1:	89 de                	mov    %ebx,%esi
  8006d3:	cd 30                	int    $0x30
	if(check && ret > 0)
  8006d5:	85 c0                	test   %eax,%eax
  8006d7:	7f 08                	jg     8006e1 <sys_env_set_status+0x2f>
	return syscall(SYS_env_set_status, 1, envid, status, 0, 0, 0);
}
  8006d9:	8d 65 f4             	lea    -0xc(%ebp),%esp
  8006dc:	5b                   	pop    %ebx
  8006dd:	5e                   	pop    %esi
  8006de:	5f                   	pop    %edi
  8006df:	5d                   	pop    %ebp
  8006e0:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  8006e1:	83 ec 0c             	sub    $0xc,%esp
  8006e4:	50                   	push   %eax
  8006e5:	6a 08                	push   $0x8
  8006e7:	68 8f 1f 80 00       	push   $0x801f8f
  8006ec:	6a 23                	push   $0x23
  8006ee:	68 ac 1f 80 00       	push   $0x801fac
  8006f3:	e8 3d 0e 00 00       	call   801535 <_panic>

008006f8 <sys_env_set_trapframe>:

int
sys_env_set_trapframe(envid_t envid, struct Trapframe *tf)
{
  8006f8:	f3 0f 1e fb          	endbr32 
  8006fc:	55                   	push   %ebp
  8006fd:	89 e5                	mov    %esp,%ebp
  8006ff:	57                   	push   %edi
  800700:	56                   	push   %esi
  800701:	53                   	push   %ebx
  800702:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800705:	bb 00 00 00 00       	mov    $0x0,%ebx
  80070a:	8b 55 08             	mov    0x8(%ebp),%edx
  80070d:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800710:	b8 09 00 00 00       	mov    $0x9,%eax
  800715:	89 df                	mov    %ebx,%edi
  800717:	89 de                	mov    %ebx,%esi
  800719:	cd 30                	int    $0x30
	if(check && ret > 0)
  80071b:	85 c0                	test   %eax,%eax
  80071d:	7f 08                	jg     800727 <sys_env_set_trapframe+0x2f>
	return syscall(SYS_env_set_trapframe, 1, envid, (uint32_t) tf, 0, 0, 0);
}
  80071f:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800722:	5b                   	pop    %ebx
  800723:	5e                   	pop    %esi
  800724:	5f                   	pop    %edi
  800725:	5d                   	pop    %ebp
  800726:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800727:	83 ec 0c             	sub    $0xc,%esp
  80072a:	50                   	push   %eax
  80072b:	6a 09                	push   $0x9
  80072d:	68 8f 1f 80 00       	push   $0x801f8f
  800732:	6a 23                	push   $0x23
  800734:	68 ac 1f 80 00       	push   $0x801fac
  800739:	e8 f7 0d 00 00       	call   801535 <_panic>

0080073e <sys_env_set_pgfault_upcall>:

int
sys_env_set_pgfault_upcall(envid_t envid, void *upcall)
{
  80073e:	f3 0f 1e fb          	endbr32 
  800742:	55                   	push   %ebp
  800743:	89 e5                	mov    %esp,%ebp
  800745:	57                   	push   %edi
  800746:	56                   	push   %esi
  800747:	53                   	push   %ebx
  800748:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  80074b:	bb 00 00 00 00       	mov    $0x0,%ebx
  800750:	8b 55 08             	mov    0x8(%ebp),%edx
  800753:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800756:	b8 0a 00 00 00       	mov    $0xa,%eax
  80075b:	89 df                	mov    %ebx,%edi
  80075d:	89 de                	mov    %ebx,%esi
  80075f:	cd 30                	int    $0x30
	if(check && ret > 0)
  800761:	85 c0                	test   %eax,%eax
  800763:	7f 08                	jg     80076d <sys_env_set_pgfault_upcall+0x2f>
	return syscall(SYS_env_set_pgfault_upcall, 1, envid, (uint32_t) upcall, 0, 0, 0);
}
  800765:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800768:	5b                   	pop    %ebx
  800769:	5e                   	pop    %esi
  80076a:	5f                   	pop    %edi
  80076b:	5d                   	pop    %ebp
  80076c:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  80076d:	83 ec 0c             	sub    $0xc,%esp
  800770:	50                   	push   %eax
  800771:	6a 0a                	push   $0xa
  800773:	68 8f 1f 80 00       	push   $0x801f8f
  800778:	6a 23                	push   $0x23
  80077a:	68 ac 1f 80 00       	push   $0x801fac
  80077f:	e8 b1 0d 00 00       	call   801535 <_panic>

00800784 <sys_ipc_try_send>:

int
sys_ipc_try_send(envid_t envid, uint32_t value, void *srcva, int perm)
{
  800784:	f3 0f 1e fb          	endbr32 
  800788:	55                   	push   %ebp
  800789:	89 e5                	mov    %esp,%ebp
  80078b:	57                   	push   %edi
  80078c:	56                   	push   %esi
  80078d:	53                   	push   %ebx
	asm volatile("int %1\n"
  80078e:	8b 55 08             	mov    0x8(%ebp),%edx
  800791:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800794:	b8 0c 00 00 00       	mov    $0xc,%eax
  800799:	be 00 00 00 00       	mov    $0x0,%esi
  80079e:	8b 5d 10             	mov    0x10(%ebp),%ebx
  8007a1:	8b 7d 14             	mov    0x14(%ebp),%edi
  8007a4:	cd 30                	int    $0x30
	return syscall(SYS_ipc_try_send, 0, envid, value, (uint32_t) srcva, perm, 0);
}
  8007a6:	5b                   	pop    %ebx
  8007a7:	5e                   	pop    %esi
  8007a8:	5f                   	pop    %edi
  8007a9:	5d                   	pop    %ebp
  8007aa:	c3                   	ret    

008007ab <sys_ipc_recv>:

int
sys_ipc_recv(void *dstva)
{
  8007ab:	f3 0f 1e fb          	endbr32 
  8007af:	55                   	push   %ebp
  8007b0:	89 e5                	mov    %esp,%ebp
  8007b2:	57                   	push   %edi
  8007b3:	56                   	push   %esi
  8007b4:	53                   	push   %ebx
  8007b5:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  8007b8:	b9 00 00 00 00       	mov    $0x0,%ecx
  8007bd:	8b 55 08             	mov    0x8(%ebp),%edx
  8007c0:	b8 0d 00 00 00       	mov    $0xd,%eax
  8007c5:	89 cb                	mov    %ecx,%ebx
  8007c7:	89 cf                	mov    %ecx,%edi
  8007c9:	89 ce                	mov    %ecx,%esi
  8007cb:	cd 30                	int    $0x30
	if(check && ret > 0)
  8007cd:	85 c0                	test   %eax,%eax
  8007cf:	7f 08                	jg     8007d9 <sys_ipc_recv+0x2e>
	return syscall(SYS_ipc_recv, 1, (uint32_t)dstva, 0, 0, 0, 0);
}
  8007d1:	8d 65 f4             	lea    -0xc(%ebp),%esp
  8007d4:	5b                   	pop    %ebx
  8007d5:	5e                   	pop    %esi
  8007d6:	5f                   	pop    %edi
  8007d7:	5d                   	pop    %ebp
  8007d8:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  8007d9:	83 ec 0c             	sub    $0xc,%esp
  8007dc:	50                   	push   %eax
  8007dd:	6a 0d                	push   $0xd
  8007df:	68 8f 1f 80 00       	push   $0x801f8f
  8007e4:	6a 23                	push   $0x23
  8007e6:	68 ac 1f 80 00       	push   $0x801fac
  8007eb:	e8 45 0d 00 00       	call   801535 <_panic>

008007f0 <fd2num>:
// File descriptor manipulators
// --------------------------------------------------------------

int
fd2num(struct Fd *fd)
{
  8007f0:	f3 0f 1e fb          	endbr32 
  8007f4:	55                   	push   %ebp
  8007f5:	89 e5                	mov    %esp,%ebp
	return ((uintptr_t) fd - FDTABLE) / PGSIZE;
  8007f7:	8b 45 08             	mov    0x8(%ebp),%eax
  8007fa:	05 00 00 00 30       	add    $0x30000000,%eax
  8007ff:	c1 e8 0c             	shr    $0xc,%eax
}
  800802:	5d                   	pop    %ebp
  800803:	c3                   	ret    

00800804 <fd2data>:

char*
fd2data(struct Fd *fd)
{
  800804:	f3 0f 1e fb          	endbr32 
  800808:	55                   	push   %ebp
  800809:	89 e5                	mov    %esp,%ebp
	return ((uintptr_t) fd - FDTABLE) / PGSIZE;
  80080b:	8b 45 08             	mov    0x8(%ebp),%eax
  80080e:	05 00 00 00 30       	add    $0x30000000,%eax
	return INDEX2DATA(fd2num(fd));
  800813:	25 00 f0 ff ff       	and    $0xfffff000,%eax
  800818:	2d 00 00 fe 2f       	sub    $0x2ffe0000,%eax
}
  80081d:	5d                   	pop    %ebp
  80081e:	c3                   	ret    

0080081f <fd_alloc>:
// Returns 0 on success, < 0 on error.  Errors are:
//	-E_MAX_FD: no more file descriptors
// On error, *fd_store is set to 0.
int
fd_alloc(struct Fd **fd_store)
{
  80081f:	f3 0f 1e fb          	endbr32 
  800823:	55                   	push   %ebp
  800824:	89 e5                	mov    %esp,%ebp
  800826:	b8 00 00 00 d0       	mov    $0xd0000000,%eax
	int i;
	struct Fd *fd;

	for (i = 0; i < MAXFD; i++) {
		fd = INDEX2FD(i);
		if ((uvpd[PDX(fd)] & PTE_P) == 0 || (uvpt[PGNUM(fd)] & PTE_P) == 0) {
  80082b:	89 c2                	mov    %eax,%edx
  80082d:	c1 ea 16             	shr    $0x16,%edx
  800830:	8b 14 95 00 d0 7b ef 	mov    -0x10843000(,%edx,4),%edx
  800837:	f6 c2 01             	test   $0x1,%dl
  80083a:	74 2d                	je     800869 <fd_alloc+0x4a>
  80083c:	89 c2                	mov    %eax,%edx
  80083e:	c1 ea 0c             	shr    $0xc,%edx
  800841:	8b 14 95 00 00 40 ef 	mov    -0x10c00000(,%edx,4),%edx
  800848:	f6 c2 01             	test   $0x1,%dl
  80084b:	74 1c                	je     800869 <fd_alloc+0x4a>
  80084d:	05 00 10 00 00       	add    $0x1000,%eax
	for (i = 0; i < MAXFD; i++) {
  800852:	3d 00 00 02 d0       	cmp    $0xd0020000,%eax
  800857:	75 d2                	jne    80082b <fd_alloc+0xc>
			*fd_store = fd;
			return 0;
		}
	}
	*fd_store = 0;
  800859:	8b 45 08             	mov    0x8(%ebp),%eax
  80085c:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
	return -E_MAX_OPEN;
  800862:	b8 f6 ff ff ff       	mov    $0xfffffff6,%eax
  800867:	eb 0a                	jmp    800873 <fd_alloc+0x54>
			*fd_store = fd;
  800869:	8b 4d 08             	mov    0x8(%ebp),%ecx
  80086c:	89 01                	mov    %eax,(%ecx)
			return 0;
  80086e:	b8 00 00 00 00       	mov    $0x0,%eax
}
  800873:	5d                   	pop    %ebp
  800874:	c3                   	ret    

00800875 <fd_lookup>:
// Returns 0 on success (the page is in range and mapped), < 0 on error.
// Errors are:
//	-E_INVAL: fdnum was either not in range or not mapped.
int
fd_lookup(int fdnum, struct Fd **fd_store)
{
  800875:	f3 0f 1e fb          	endbr32 
  800879:	55                   	push   %ebp
  80087a:	89 e5                	mov    %esp,%ebp
  80087c:	8b 45 08             	mov    0x8(%ebp),%eax
	struct Fd *fd;

	if (fdnum < 0 || fdnum >= MAXFD) {
  80087f:	83 f8 1f             	cmp    $0x1f,%eax
  800882:	77 30                	ja     8008b4 <fd_lookup+0x3f>
		if (debug)
			cprintf("[%08x] bad fd %d\n", thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	fd = INDEX2FD(fdnum);
  800884:	c1 e0 0c             	shl    $0xc,%eax
  800887:	2d 00 00 00 30       	sub    $0x30000000,%eax
	if (!(uvpd[PDX(fd)] & PTE_P) || !(uvpt[PGNUM(fd)] & PTE_P)) {
  80088c:	8b 15 00 dd 7b ef    	mov    0xef7bdd00,%edx
  800892:	f6 c2 01             	test   $0x1,%dl
  800895:	74 24                	je     8008bb <fd_lookup+0x46>
  800897:	89 c2                	mov    %eax,%edx
  800899:	c1 ea 0c             	shr    $0xc,%edx
  80089c:	8b 14 95 00 00 40 ef 	mov    -0x10c00000(,%edx,4),%edx
  8008a3:	f6 c2 01             	test   $0x1,%dl
  8008a6:	74 1a                	je     8008c2 <fd_lookup+0x4d>
		if (debug)
			cprintf("[%08x] closed fd %d\n", thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	*fd_store = fd;
  8008a8:	8b 55 0c             	mov    0xc(%ebp),%edx
  8008ab:	89 02                	mov    %eax,(%edx)
	return 0;
  8008ad:	b8 00 00 00 00       	mov    $0x0,%eax
}
  8008b2:	5d                   	pop    %ebp
  8008b3:	c3                   	ret    
		return -E_INVAL;
  8008b4:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  8008b9:	eb f7                	jmp    8008b2 <fd_lookup+0x3d>
		return -E_INVAL;
  8008bb:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  8008c0:	eb f0                	jmp    8008b2 <fd_lookup+0x3d>
  8008c2:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  8008c7:	eb e9                	jmp    8008b2 <fd_lookup+0x3d>

008008c9 <dev_lookup>:
	0
};

int
dev_lookup(int dev_id, struct Dev **dev)
{
  8008c9:	f3 0f 1e fb          	endbr32 
  8008cd:	55                   	push   %ebp
  8008ce:	89 e5                	mov    %esp,%ebp
  8008d0:	83 ec 08             	sub    $0x8,%esp
  8008d3:	8b 4d 08             	mov    0x8(%ebp),%ecx
  8008d6:	ba 38 20 80 00       	mov    $0x802038,%edx
	int i;
	for (i = 0; devtab[i]; i++)
  8008db:	b8 04 30 80 00       	mov    $0x803004,%eax
		if (devtab[i]->dev_id == dev_id) {
  8008e0:	39 08                	cmp    %ecx,(%eax)
  8008e2:	74 33                	je     800917 <dev_lookup+0x4e>
  8008e4:	83 c2 04             	add    $0x4,%edx
	for (i = 0; devtab[i]; i++)
  8008e7:	8b 02                	mov    (%edx),%eax
  8008e9:	85 c0                	test   %eax,%eax
  8008eb:	75 f3                	jne    8008e0 <dev_lookup+0x17>
			*dev = devtab[i];
			return 0;
		}
	cprintf("[%08x] unknown device type %d\n", thisenv->env_id, dev_id);
  8008ed:	a1 04 40 80 00       	mov    0x804004,%eax
  8008f2:	8b 40 48             	mov    0x48(%eax),%eax
  8008f5:	83 ec 04             	sub    $0x4,%esp
  8008f8:	51                   	push   %ecx
  8008f9:	50                   	push   %eax
  8008fa:	68 bc 1f 80 00       	push   $0x801fbc
  8008ff:	e8 18 0d 00 00       	call   80161c <cprintf>
	*dev = 0;
  800904:	8b 45 0c             	mov    0xc(%ebp),%eax
  800907:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
	return -E_INVAL;
  80090d:	83 c4 10             	add    $0x10,%esp
  800910:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
}
  800915:	c9                   	leave  
  800916:	c3                   	ret    
			*dev = devtab[i];
  800917:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  80091a:	89 01                	mov    %eax,(%ecx)
			return 0;
  80091c:	b8 00 00 00 00       	mov    $0x0,%eax
  800921:	eb f2                	jmp    800915 <dev_lookup+0x4c>

00800923 <fd_close>:
{
  800923:	f3 0f 1e fb          	endbr32 
  800927:	55                   	push   %ebp
  800928:	89 e5                	mov    %esp,%ebp
  80092a:	57                   	push   %edi
  80092b:	56                   	push   %esi
  80092c:	53                   	push   %ebx
  80092d:	83 ec 24             	sub    $0x24,%esp
  800930:	8b 75 08             	mov    0x8(%ebp),%esi
  800933:	8b 7d 0c             	mov    0xc(%ebp),%edi
	if ((r = fd_lookup(fd2num(fd), &fd2)) < 0
  800936:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  800939:	50                   	push   %eax
	return ((uintptr_t) fd - FDTABLE) / PGSIZE;
  80093a:	8d 86 00 00 00 30    	lea    0x30000000(%esi),%eax
  800940:	c1 e8 0c             	shr    $0xc,%eax
	if ((r = fd_lookup(fd2num(fd), &fd2)) < 0
  800943:	50                   	push   %eax
  800944:	e8 2c ff ff ff       	call   800875 <fd_lookup>
  800949:	89 c3                	mov    %eax,%ebx
  80094b:	83 c4 10             	add    $0x10,%esp
  80094e:	85 c0                	test   %eax,%eax
  800950:	78 05                	js     800957 <fd_close+0x34>
	    || fd != fd2)
  800952:	39 75 e4             	cmp    %esi,-0x1c(%ebp)
  800955:	74 16                	je     80096d <fd_close+0x4a>
		return (must_exist ? r : 0);
  800957:	89 f8                	mov    %edi,%eax
  800959:	84 c0                	test   %al,%al
  80095b:	b8 00 00 00 00       	mov    $0x0,%eax
  800960:	0f 44 d8             	cmove  %eax,%ebx
}
  800963:	89 d8                	mov    %ebx,%eax
  800965:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800968:	5b                   	pop    %ebx
  800969:	5e                   	pop    %esi
  80096a:	5f                   	pop    %edi
  80096b:	5d                   	pop    %ebp
  80096c:	c3                   	ret    
	if ((r = dev_lookup(fd->fd_dev_id, &dev)) >= 0) {
  80096d:	83 ec 08             	sub    $0x8,%esp
  800970:	8d 45 e0             	lea    -0x20(%ebp),%eax
  800973:	50                   	push   %eax
  800974:	ff 36                	pushl  (%esi)
  800976:	e8 4e ff ff ff       	call   8008c9 <dev_lookup>
  80097b:	89 c3                	mov    %eax,%ebx
  80097d:	83 c4 10             	add    $0x10,%esp
  800980:	85 c0                	test   %eax,%eax
  800982:	78 1a                	js     80099e <fd_close+0x7b>
		if (dev->dev_close)
  800984:	8b 45 e0             	mov    -0x20(%ebp),%eax
  800987:	8b 40 10             	mov    0x10(%eax),%eax
			r = 0;
  80098a:	bb 00 00 00 00       	mov    $0x0,%ebx
		if (dev->dev_close)
  80098f:	85 c0                	test   %eax,%eax
  800991:	74 0b                	je     80099e <fd_close+0x7b>
			r = (*dev->dev_close)(fd);
  800993:	83 ec 0c             	sub    $0xc,%esp
  800996:	56                   	push   %esi
  800997:	ff d0                	call   *%eax
  800999:	89 c3                	mov    %eax,%ebx
  80099b:	83 c4 10             	add    $0x10,%esp
	(void) sys_page_unmap(0, fd);
  80099e:	83 ec 08             	sub    $0x8,%esp
  8009a1:	56                   	push   %esi
  8009a2:	6a 00                	push   $0x0
  8009a4:	e8 c3 fc ff ff       	call   80066c <sys_page_unmap>
	return r;
  8009a9:	83 c4 10             	add    $0x10,%esp
  8009ac:	eb b5                	jmp    800963 <fd_close+0x40>

008009ae <close>:

int
close(int fdnum)
{
  8009ae:	f3 0f 1e fb          	endbr32 
  8009b2:	55                   	push   %ebp
  8009b3:	89 e5                	mov    %esp,%ebp
  8009b5:	83 ec 20             	sub    $0x20,%esp
	struct Fd *fd;
	int r;

	if ((r = fd_lookup(fdnum, &fd)) < 0)
  8009b8:	8d 45 f4             	lea    -0xc(%ebp),%eax
  8009bb:	50                   	push   %eax
  8009bc:	ff 75 08             	pushl  0x8(%ebp)
  8009bf:	e8 b1 fe ff ff       	call   800875 <fd_lookup>
  8009c4:	83 c4 10             	add    $0x10,%esp
  8009c7:	85 c0                	test   %eax,%eax
  8009c9:	79 02                	jns    8009cd <close+0x1f>
		return r;
	else
		return fd_close(fd, 1);
}
  8009cb:	c9                   	leave  
  8009cc:	c3                   	ret    
		return fd_close(fd, 1);
  8009cd:	83 ec 08             	sub    $0x8,%esp
  8009d0:	6a 01                	push   $0x1
  8009d2:	ff 75 f4             	pushl  -0xc(%ebp)
  8009d5:	e8 49 ff ff ff       	call   800923 <fd_close>
  8009da:	83 c4 10             	add    $0x10,%esp
  8009dd:	eb ec                	jmp    8009cb <close+0x1d>

008009df <close_all>:

void
close_all(void)
{
  8009df:	f3 0f 1e fb          	endbr32 
  8009e3:	55                   	push   %ebp
  8009e4:	89 e5                	mov    %esp,%ebp
  8009e6:	53                   	push   %ebx
  8009e7:	83 ec 04             	sub    $0x4,%esp
	int i;
	for (i = 0; i < MAXFD; i++)
  8009ea:	bb 00 00 00 00       	mov    $0x0,%ebx
		close(i);
  8009ef:	83 ec 0c             	sub    $0xc,%esp
  8009f2:	53                   	push   %ebx
  8009f3:	e8 b6 ff ff ff       	call   8009ae <close>
	for (i = 0; i < MAXFD; i++)
  8009f8:	83 c3 01             	add    $0x1,%ebx
  8009fb:	83 c4 10             	add    $0x10,%esp
  8009fe:	83 fb 20             	cmp    $0x20,%ebx
  800a01:	75 ec                	jne    8009ef <close_all+0x10>
}
  800a03:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  800a06:	c9                   	leave  
  800a07:	c3                   	ret    

00800a08 <dup>:
// file and the file offset of the other.
// Closes any previously open file descriptor at 'newfdnum'.
// This is implemented using virtual memory tricks (of course!).
int
dup(int oldfdnum, int newfdnum)
{
  800a08:	f3 0f 1e fb          	endbr32 
  800a0c:	55                   	push   %ebp
  800a0d:	89 e5                	mov    %esp,%ebp
  800a0f:	57                   	push   %edi
  800a10:	56                   	push   %esi
  800a11:	53                   	push   %ebx
  800a12:	83 ec 24             	sub    $0x24,%esp
	int r;
	char *ova, *nva;
	pte_t pte;
	struct Fd *oldfd, *newfd;

	if ((r = fd_lookup(oldfdnum, &oldfd)) < 0)
  800a15:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  800a18:	50                   	push   %eax
  800a19:	ff 75 08             	pushl  0x8(%ebp)
  800a1c:	e8 54 fe ff ff       	call   800875 <fd_lookup>
  800a21:	89 c3                	mov    %eax,%ebx
  800a23:	83 c4 10             	add    $0x10,%esp
  800a26:	85 c0                	test   %eax,%eax
  800a28:	0f 88 81 00 00 00    	js     800aaf <dup+0xa7>
		return r;
	close(newfdnum);
  800a2e:	83 ec 0c             	sub    $0xc,%esp
  800a31:	ff 75 0c             	pushl  0xc(%ebp)
  800a34:	e8 75 ff ff ff       	call   8009ae <close>

	newfd = INDEX2FD(newfdnum);
  800a39:	8b 75 0c             	mov    0xc(%ebp),%esi
  800a3c:	c1 e6 0c             	shl    $0xc,%esi
  800a3f:	81 ee 00 00 00 30    	sub    $0x30000000,%esi
	ova = fd2data(oldfd);
  800a45:	83 c4 04             	add    $0x4,%esp
  800a48:	ff 75 e4             	pushl  -0x1c(%ebp)
  800a4b:	e8 b4 fd ff ff       	call   800804 <fd2data>
  800a50:	89 c3                	mov    %eax,%ebx
	nva = fd2data(newfd);
  800a52:	89 34 24             	mov    %esi,(%esp)
  800a55:	e8 aa fd ff ff       	call   800804 <fd2data>
  800a5a:	83 c4 10             	add    $0x10,%esp
  800a5d:	89 c7                	mov    %eax,%edi

	if ((uvpd[PDX(ova)] & PTE_P) && (uvpt[PGNUM(ova)] & PTE_P))
  800a5f:	89 d8                	mov    %ebx,%eax
  800a61:	c1 e8 16             	shr    $0x16,%eax
  800a64:	8b 04 85 00 d0 7b ef 	mov    -0x10843000(,%eax,4),%eax
  800a6b:	a8 01                	test   $0x1,%al
  800a6d:	74 11                	je     800a80 <dup+0x78>
  800a6f:	89 d8                	mov    %ebx,%eax
  800a71:	c1 e8 0c             	shr    $0xc,%eax
  800a74:	8b 14 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%edx
  800a7b:	f6 c2 01             	test   $0x1,%dl
  800a7e:	75 39                	jne    800ab9 <dup+0xb1>
		if ((r = sys_page_map(0, ova, 0, nva, uvpt[PGNUM(ova)] & PTE_SYSCALL)) < 0)
			goto err;
	if ((r = sys_page_map(0, oldfd, 0, newfd, uvpt[PGNUM(oldfd)] & PTE_SYSCALL)) < 0)
  800a80:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  800a83:	89 d0                	mov    %edx,%eax
  800a85:	c1 e8 0c             	shr    $0xc,%eax
  800a88:	8b 04 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%eax
  800a8f:	83 ec 0c             	sub    $0xc,%esp
  800a92:	25 07 0e 00 00       	and    $0xe07,%eax
  800a97:	50                   	push   %eax
  800a98:	56                   	push   %esi
  800a99:	6a 00                	push   $0x0
  800a9b:	52                   	push   %edx
  800a9c:	6a 00                	push   $0x0
  800a9e:	e8 83 fb ff ff       	call   800626 <sys_page_map>
  800aa3:	89 c3                	mov    %eax,%ebx
  800aa5:	83 c4 20             	add    $0x20,%esp
  800aa8:	85 c0                	test   %eax,%eax
  800aaa:	78 31                	js     800add <dup+0xd5>
		goto err;

	return newfdnum;
  800aac:	8b 5d 0c             	mov    0xc(%ebp),%ebx

err:
	sys_page_unmap(0, newfd);
	sys_page_unmap(0, nva);
	return r;
}
  800aaf:	89 d8                	mov    %ebx,%eax
  800ab1:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800ab4:	5b                   	pop    %ebx
  800ab5:	5e                   	pop    %esi
  800ab6:	5f                   	pop    %edi
  800ab7:	5d                   	pop    %ebp
  800ab8:	c3                   	ret    
		if ((r = sys_page_map(0, ova, 0, nva, uvpt[PGNUM(ova)] & PTE_SYSCALL)) < 0)
  800ab9:	8b 04 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%eax
  800ac0:	83 ec 0c             	sub    $0xc,%esp
  800ac3:	25 07 0e 00 00       	and    $0xe07,%eax
  800ac8:	50                   	push   %eax
  800ac9:	57                   	push   %edi
  800aca:	6a 00                	push   $0x0
  800acc:	53                   	push   %ebx
  800acd:	6a 00                	push   $0x0
  800acf:	e8 52 fb ff ff       	call   800626 <sys_page_map>
  800ad4:	89 c3                	mov    %eax,%ebx
  800ad6:	83 c4 20             	add    $0x20,%esp
  800ad9:	85 c0                	test   %eax,%eax
  800adb:	79 a3                	jns    800a80 <dup+0x78>
	sys_page_unmap(0, newfd);
  800add:	83 ec 08             	sub    $0x8,%esp
  800ae0:	56                   	push   %esi
  800ae1:	6a 00                	push   $0x0
  800ae3:	e8 84 fb ff ff       	call   80066c <sys_page_unmap>
	sys_page_unmap(0, nva);
  800ae8:	83 c4 08             	add    $0x8,%esp
  800aeb:	57                   	push   %edi
  800aec:	6a 00                	push   $0x0
  800aee:	e8 79 fb ff ff       	call   80066c <sys_page_unmap>
	return r;
  800af3:	83 c4 10             	add    $0x10,%esp
  800af6:	eb b7                	jmp    800aaf <dup+0xa7>

00800af8 <read>:

ssize_t
read(int fdnum, void *buf, size_t n)
{
  800af8:	f3 0f 1e fb          	endbr32 
  800afc:	55                   	push   %ebp
  800afd:	89 e5                	mov    %esp,%ebp
  800aff:	53                   	push   %ebx
  800b00:	83 ec 1c             	sub    $0x1c,%esp
  800b03:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0
  800b06:	8d 45 f0             	lea    -0x10(%ebp),%eax
  800b09:	50                   	push   %eax
  800b0a:	53                   	push   %ebx
  800b0b:	e8 65 fd ff ff       	call   800875 <fd_lookup>
  800b10:	83 c4 10             	add    $0x10,%esp
  800b13:	85 c0                	test   %eax,%eax
  800b15:	78 3f                	js     800b56 <read+0x5e>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  800b17:	83 ec 08             	sub    $0x8,%esp
  800b1a:	8d 45 f4             	lea    -0xc(%ebp),%eax
  800b1d:	50                   	push   %eax
  800b1e:	8b 45 f0             	mov    -0x10(%ebp),%eax
  800b21:	ff 30                	pushl  (%eax)
  800b23:	e8 a1 fd ff ff       	call   8008c9 <dev_lookup>
  800b28:	83 c4 10             	add    $0x10,%esp
  800b2b:	85 c0                	test   %eax,%eax
  800b2d:	78 27                	js     800b56 <read+0x5e>
		return r;
	if ((fd->fd_omode & O_ACCMODE) == O_WRONLY) {
  800b2f:	8b 55 f0             	mov    -0x10(%ebp),%edx
  800b32:	8b 42 08             	mov    0x8(%edx),%eax
  800b35:	83 e0 03             	and    $0x3,%eax
  800b38:	83 f8 01             	cmp    $0x1,%eax
  800b3b:	74 1e                	je     800b5b <read+0x63>
		cprintf("[%08x] read %d -- bad mode\n", thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	if (!dev->dev_read)
  800b3d:	8b 45 f4             	mov    -0xc(%ebp),%eax
  800b40:	8b 40 08             	mov    0x8(%eax),%eax
  800b43:	85 c0                	test   %eax,%eax
  800b45:	74 35                	je     800b7c <read+0x84>
		return -E_NOT_SUPP;
	return (*dev->dev_read)(fd, buf, n);
  800b47:	83 ec 04             	sub    $0x4,%esp
  800b4a:	ff 75 10             	pushl  0x10(%ebp)
  800b4d:	ff 75 0c             	pushl  0xc(%ebp)
  800b50:	52                   	push   %edx
  800b51:	ff d0                	call   *%eax
  800b53:	83 c4 10             	add    $0x10,%esp
}
  800b56:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  800b59:	c9                   	leave  
  800b5a:	c3                   	ret    
		cprintf("[%08x] read %d -- bad mode\n", thisenv->env_id, fdnum);
  800b5b:	a1 04 40 80 00       	mov    0x804004,%eax
  800b60:	8b 40 48             	mov    0x48(%eax),%eax
  800b63:	83 ec 04             	sub    $0x4,%esp
  800b66:	53                   	push   %ebx
  800b67:	50                   	push   %eax
  800b68:	68 fd 1f 80 00       	push   $0x801ffd
  800b6d:	e8 aa 0a 00 00       	call   80161c <cprintf>
		return -E_INVAL;
  800b72:	83 c4 10             	add    $0x10,%esp
  800b75:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  800b7a:	eb da                	jmp    800b56 <read+0x5e>
		return -E_NOT_SUPP;
  800b7c:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  800b81:	eb d3                	jmp    800b56 <read+0x5e>

00800b83 <readn>:

ssize_t
readn(int fdnum, void *buf, size_t n)
{
  800b83:	f3 0f 1e fb          	endbr32 
  800b87:	55                   	push   %ebp
  800b88:	89 e5                	mov    %esp,%ebp
  800b8a:	57                   	push   %edi
  800b8b:	56                   	push   %esi
  800b8c:	53                   	push   %ebx
  800b8d:	83 ec 0c             	sub    $0xc,%esp
  800b90:	8b 7d 08             	mov    0x8(%ebp),%edi
  800b93:	8b 75 10             	mov    0x10(%ebp),%esi
	int m, tot;

	for (tot = 0; tot < n; tot += m) {
  800b96:	bb 00 00 00 00       	mov    $0x0,%ebx
  800b9b:	eb 02                	jmp    800b9f <readn+0x1c>
  800b9d:	01 c3                	add    %eax,%ebx
  800b9f:	39 f3                	cmp    %esi,%ebx
  800ba1:	73 21                	jae    800bc4 <readn+0x41>
		m = read(fdnum, (char*)buf + tot, n - tot);
  800ba3:	83 ec 04             	sub    $0x4,%esp
  800ba6:	89 f0                	mov    %esi,%eax
  800ba8:	29 d8                	sub    %ebx,%eax
  800baa:	50                   	push   %eax
  800bab:	89 d8                	mov    %ebx,%eax
  800bad:	03 45 0c             	add    0xc(%ebp),%eax
  800bb0:	50                   	push   %eax
  800bb1:	57                   	push   %edi
  800bb2:	e8 41 ff ff ff       	call   800af8 <read>
		if (m < 0)
  800bb7:	83 c4 10             	add    $0x10,%esp
  800bba:	85 c0                	test   %eax,%eax
  800bbc:	78 04                	js     800bc2 <readn+0x3f>
			return m;
		if (m == 0)
  800bbe:	75 dd                	jne    800b9d <readn+0x1a>
  800bc0:	eb 02                	jmp    800bc4 <readn+0x41>
		m = read(fdnum, (char*)buf + tot, n - tot);
  800bc2:	89 c3                	mov    %eax,%ebx
			break;
	}
	return tot;
}
  800bc4:	89 d8                	mov    %ebx,%eax
  800bc6:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800bc9:	5b                   	pop    %ebx
  800bca:	5e                   	pop    %esi
  800bcb:	5f                   	pop    %edi
  800bcc:	5d                   	pop    %ebp
  800bcd:	c3                   	ret    

00800bce <write>:

ssize_t
write(int fdnum, const void *buf, size_t n)
{
  800bce:	f3 0f 1e fb          	endbr32 
  800bd2:	55                   	push   %ebp
  800bd3:	89 e5                	mov    %esp,%ebp
  800bd5:	53                   	push   %ebx
  800bd6:	83 ec 1c             	sub    $0x1c,%esp
  800bd9:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0
  800bdc:	8d 45 f0             	lea    -0x10(%ebp),%eax
  800bdf:	50                   	push   %eax
  800be0:	53                   	push   %ebx
  800be1:	e8 8f fc ff ff       	call   800875 <fd_lookup>
  800be6:	83 c4 10             	add    $0x10,%esp
  800be9:	85 c0                	test   %eax,%eax
  800beb:	78 3a                	js     800c27 <write+0x59>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  800bed:	83 ec 08             	sub    $0x8,%esp
  800bf0:	8d 45 f4             	lea    -0xc(%ebp),%eax
  800bf3:	50                   	push   %eax
  800bf4:	8b 45 f0             	mov    -0x10(%ebp),%eax
  800bf7:	ff 30                	pushl  (%eax)
  800bf9:	e8 cb fc ff ff       	call   8008c9 <dev_lookup>
  800bfe:	83 c4 10             	add    $0x10,%esp
  800c01:	85 c0                	test   %eax,%eax
  800c03:	78 22                	js     800c27 <write+0x59>
		return r;
	if ((fd->fd_omode & O_ACCMODE) == O_RDONLY) {
  800c05:	8b 45 f0             	mov    -0x10(%ebp),%eax
  800c08:	f6 40 08 03          	testb  $0x3,0x8(%eax)
  800c0c:	74 1e                	je     800c2c <write+0x5e>
		return -E_INVAL;
	}
	if (debug)
		cprintf("write %d %p %d via dev %s\n",
			fdnum, buf, n, dev->dev_name);
	if (!dev->dev_write)
  800c0e:	8b 55 f4             	mov    -0xc(%ebp),%edx
  800c11:	8b 52 0c             	mov    0xc(%edx),%edx
  800c14:	85 d2                	test   %edx,%edx
  800c16:	74 35                	je     800c4d <write+0x7f>
		return -E_NOT_SUPP;
	return (*dev->dev_write)(fd, buf, n);
  800c18:	83 ec 04             	sub    $0x4,%esp
  800c1b:	ff 75 10             	pushl  0x10(%ebp)
  800c1e:	ff 75 0c             	pushl  0xc(%ebp)
  800c21:	50                   	push   %eax
  800c22:	ff d2                	call   *%edx
  800c24:	83 c4 10             	add    $0x10,%esp
}
  800c27:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  800c2a:	c9                   	leave  
  800c2b:	c3                   	ret    
		cprintf("[%08x] write %d -- bad mode\n", thisenv->env_id, fdnum);
  800c2c:	a1 04 40 80 00       	mov    0x804004,%eax
  800c31:	8b 40 48             	mov    0x48(%eax),%eax
  800c34:	83 ec 04             	sub    $0x4,%esp
  800c37:	53                   	push   %ebx
  800c38:	50                   	push   %eax
  800c39:	68 19 20 80 00       	push   $0x802019
  800c3e:	e8 d9 09 00 00       	call   80161c <cprintf>
		return -E_INVAL;
  800c43:	83 c4 10             	add    $0x10,%esp
  800c46:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  800c4b:	eb da                	jmp    800c27 <write+0x59>
		return -E_NOT_SUPP;
  800c4d:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  800c52:	eb d3                	jmp    800c27 <write+0x59>

00800c54 <seek>:

int
seek(int fdnum, off_t offset)
{
  800c54:	f3 0f 1e fb          	endbr32 
  800c58:	55                   	push   %ebp
  800c59:	89 e5                	mov    %esp,%ebp
  800c5b:	83 ec 20             	sub    $0x20,%esp
	int r;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0)
  800c5e:	8d 45 f4             	lea    -0xc(%ebp),%eax
  800c61:	50                   	push   %eax
  800c62:	ff 75 08             	pushl  0x8(%ebp)
  800c65:	e8 0b fc ff ff       	call   800875 <fd_lookup>
  800c6a:	83 c4 10             	add    $0x10,%esp
  800c6d:	85 c0                	test   %eax,%eax
  800c6f:	78 0e                	js     800c7f <seek+0x2b>
		return r;
	fd->fd_offset = offset;
  800c71:	8b 55 0c             	mov    0xc(%ebp),%edx
  800c74:	8b 45 f4             	mov    -0xc(%ebp),%eax
  800c77:	89 50 04             	mov    %edx,0x4(%eax)
	return 0;
  800c7a:	b8 00 00 00 00       	mov    $0x0,%eax
}
  800c7f:	c9                   	leave  
  800c80:	c3                   	ret    

00800c81 <ftruncate>:

int
ftruncate(int fdnum, off_t newsize)
{
  800c81:	f3 0f 1e fb          	endbr32 
  800c85:	55                   	push   %ebp
  800c86:	89 e5                	mov    %esp,%ebp
  800c88:	53                   	push   %ebx
  800c89:	83 ec 1c             	sub    $0x1c,%esp
  800c8c:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;
	if ((r = fd_lookup(fdnum, &fd)) < 0
  800c8f:	8d 45 f0             	lea    -0x10(%ebp),%eax
  800c92:	50                   	push   %eax
  800c93:	53                   	push   %ebx
  800c94:	e8 dc fb ff ff       	call   800875 <fd_lookup>
  800c99:	83 c4 10             	add    $0x10,%esp
  800c9c:	85 c0                	test   %eax,%eax
  800c9e:	78 37                	js     800cd7 <ftruncate+0x56>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  800ca0:	83 ec 08             	sub    $0x8,%esp
  800ca3:	8d 45 f4             	lea    -0xc(%ebp),%eax
  800ca6:	50                   	push   %eax
  800ca7:	8b 45 f0             	mov    -0x10(%ebp),%eax
  800caa:	ff 30                	pushl  (%eax)
  800cac:	e8 18 fc ff ff       	call   8008c9 <dev_lookup>
  800cb1:	83 c4 10             	add    $0x10,%esp
  800cb4:	85 c0                	test   %eax,%eax
  800cb6:	78 1f                	js     800cd7 <ftruncate+0x56>
		return r;
	if ((fd->fd_omode & O_ACCMODE) == O_RDONLY) {
  800cb8:	8b 45 f0             	mov    -0x10(%ebp),%eax
  800cbb:	f6 40 08 03          	testb  $0x3,0x8(%eax)
  800cbf:	74 1b                	je     800cdc <ftruncate+0x5b>
		cprintf("[%08x] ftruncate %d -- bad mode\n",
			thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	if (!dev->dev_trunc)
  800cc1:	8b 55 f4             	mov    -0xc(%ebp),%edx
  800cc4:	8b 52 18             	mov    0x18(%edx),%edx
  800cc7:	85 d2                	test   %edx,%edx
  800cc9:	74 32                	je     800cfd <ftruncate+0x7c>
		return -E_NOT_SUPP;
	return (*dev->dev_trunc)(fd, newsize);
  800ccb:	83 ec 08             	sub    $0x8,%esp
  800cce:	ff 75 0c             	pushl  0xc(%ebp)
  800cd1:	50                   	push   %eax
  800cd2:	ff d2                	call   *%edx
  800cd4:	83 c4 10             	add    $0x10,%esp
}
  800cd7:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  800cda:	c9                   	leave  
  800cdb:	c3                   	ret    
			thisenv->env_id, fdnum);
  800cdc:	a1 04 40 80 00       	mov    0x804004,%eax
		cprintf("[%08x] ftruncate %d -- bad mode\n",
  800ce1:	8b 40 48             	mov    0x48(%eax),%eax
  800ce4:	83 ec 04             	sub    $0x4,%esp
  800ce7:	53                   	push   %ebx
  800ce8:	50                   	push   %eax
  800ce9:	68 dc 1f 80 00       	push   $0x801fdc
  800cee:	e8 29 09 00 00       	call   80161c <cprintf>
		return -E_INVAL;
  800cf3:	83 c4 10             	add    $0x10,%esp
  800cf6:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  800cfb:	eb da                	jmp    800cd7 <ftruncate+0x56>
		return -E_NOT_SUPP;
  800cfd:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  800d02:	eb d3                	jmp    800cd7 <ftruncate+0x56>

00800d04 <fstat>:

int
fstat(int fdnum, struct Stat *stat)
{
  800d04:	f3 0f 1e fb          	endbr32 
  800d08:	55                   	push   %ebp
  800d09:	89 e5                	mov    %esp,%ebp
  800d0b:	53                   	push   %ebx
  800d0c:	83 ec 1c             	sub    $0x1c,%esp
  800d0f:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0
  800d12:	8d 45 f0             	lea    -0x10(%ebp),%eax
  800d15:	50                   	push   %eax
  800d16:	ff 75 08             	pushl  0x8(%ebp)
  800d19:	e8 57 fb ff ff       	call   800875 <fd_lookup>
  800d1e:	83 c4 10             	add    $0x10,%esp
  800d21:	85 c0                	test   %eax,%eax
  800d23:	78 4b                	js     800d70 <fstat+0x6c>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  800d25:	83 ec 08             	sub    $0x8,%esp
  800d28:	8d 45 f4             	lea    -0xc(%ebp),%eax
  800d2b:	50                   	push   %eax
  800d2c:	8b 45 f0             	mov    -0x10(%ebp),%eax
  800d2f:	ff 30                	pushl  (%eax)
  800d31:	e8 93 fb ff ff       	call   8008c9 <dev_lookup>
  800d36:	83 c4 10             	add    $0x10,%esp
  800d39:	85 c0                	test   %eax,%eax
  800d3b:	78 33                	js     800d70 <fstat+0x6c>
		return r;
	if (!dev->dev_stat)
  800d3d:	8b 45 f4             	mov    -0xc(%ebp),%eax
  800d40:	83 78 14 00          	cmpl   $0x0,0x14(%eax)
  800d44:	74 2f                	je     800d75 <fstat+0x71>
		return -E_NOT_SUPP;
	stat->st_name[0] = 0;
  800d46:	c6 03 00             	movb   $0x0,(%ebx)
	stat->st_size = 0;
  800d49:	c7 83 80 00 00 00 00 	movl   $0x0,0x80(%ebx)
  800d50:	00 00 00 
	stat->st_isdir = 0;
  800d53:	c7 83 84 00 00 00 00 	movl   $0x0,0x84(%ebx)
  800d5a:	00 00 00 
	stat->st_dev = dev;
  800d5d:	89 83 88 00 00 00    	mov    %eax,0x88(%ebx)
	return (*dev->dev_stat)(fd, stat);
  800d63:	83 ec 08             	sub    $0x8,%esp
  800d66:	53                   	push   %ebx
  800d67:	ff 75 f0             	pushl  -0x10(%ebp)
  800d6a:	ff 50 14             	call   *0x14(%eax)
  800d6d:	83 c4 10             	add    $0x10,%esp
}
  800d70:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  800d73:	c9                   	leave  
  800d74:	c3                   	ret    
		return -E_NOT_SUPP;
  800d75:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  800d7a:	eb f4                	jmp    800d70 <fstat+0x6c>

00800d7c <stat>:

int
stat(const char *path, struct Stat *stat)
{
  800d7c:	f3 0f 1e fb          	endbr32 
  800d80:	55                   	push   %ebp
  800d81:	89 e5                	mov    %esp,%ebp
  800d83:	56                   	push   %esi
  800d84:	53                   	push   %ebx
	int fd, r;

	if ((fd = open(path, O_RDONLY)) < 0)
  800d85:	83 ec 08             	sub    $0x8,%esp
  800d88:	6a 00                	push   $0x0
  800d8a:	ff 75 08             	pushl  0x8(%ebp)
  800d8d:	e8 fb 01 00 00       	call   800f8d <open>
  800d92:	89 c3                	mov    %eax,%ebx
  800d94:	83 c4 10             	add    $0x10,%esp
  800d97:	85 c0                	test   %eax,%eax
  800d99:	78 1b                	js     800db6 <stat+0x3a>
		return fd;
	r = fstat(fd, stat);
  800d9b:	83 ec 08             	sub    $0x8,%esp
  800d9e:	ff 75 0c             	pushl  0xc(%ebp)
  800da1:	50                   	push   %eax
  800da2:	e8 5d ff ff ff       	call   800d04 <fstat>
  800da7:	89 c6                	mov    %eax,%esi
	close(fd);
  800da9:	89 1c 24             	mov    %ebx,(%esp)
  800dac:	e8 fd fb ff ff       	call   8009ae <close>
	return r;
  800db1:	83 c4 10             	add    $0x10,%esp
  800db4:	89 f3                	mov    %esi,%ebx
}
  800db6:	89 d8                	mov    %ebx,%eax
  800db8:	8d 65 f8             	lea    -0x8(%ebp),%esp
  800dbb:	5b                   	pop    %ebx
  800dbc:	5e                   	pop    %esi
  800dbd:	5d                   	pop    %ebp
  800dbe:	c3                   	ret    

00800dbf <fsipc>:
// type: request code, passed as the simple integer IPC value.
// dstva: virtual address at which to receive reply page, 0 if none.
// Returns result from the file server.
static int
fsipc(unsigned type, void *dstva)
{
  800dbf:	55                   	push   %ebp
  800dc0:	89 e5                	mov    %esp,%ebp
  800dc2:	56                   	push   %esi
  800dc3:	53                   	push   %ebx
  800dc4:	89 c6                	mov    %eax,%esi
  800dc6:	89 d3                	mov    %edx,%ebx
	static envid_t fsenv;
	if (fsenv == 0)
  800dc8:	83 3d 00 40 80 00 00 	cmpl   $0x0,0x804000
  800dcf:	74 27                	je     800df8 <fsipc+0x39>
	static_assert(sizeof(fsipcbuf) == PGSIZE);

	if (debug)
		cprintf("[%08x] fsipc %d %08x\n", thisenv->env_id, type, *(uint32_t *)&fsipcbuf);

	ipc_send(fsenv, type, &fsipcbuf, PTE_P | PTE_W | PTE_U);
  800dd1:	6a 07                	push   $0x7
  800dd3:	68 00 50 80 00       	push   $0x805000
  800dd8:	56                   	push   %esi
  800dd9:	ff 35 00 40 80 00    	pushl  0x804000
  800ddf:	e8 4f 0e 00 00       	call   801c33 <ipc_send>
	return ipc_recv(NULL, dstva, NULL);
  800de4:	83 c4 0c             	add    $0xc,%esp
  800de7:	6a 00                	push   $0x0
  800de9:	53                   	push   %ebx
  800dea:	6a 00                	push   $0x0
  800dec:	e8 c1 0d 00 00       	call   801bb2 <ipc_recv>
}
  800df1:	8d 65 f8             	lea    -0x8(%ebp),%esp
  800df4:	5b                   	pop    %ebx
  800df5:	5e                   	pop    %esi
  800df6:	5d                   	pop    %ebp
  800df7:	c3                   	ret    
		fsenv = ipc_find_env(ENV_TYPE_FS);
  800df8:	83 ec 0c             	sub    $0xc,%esp
  800dfb:	6a 01                	push   $0x1
  800dfd:	e8 89 0e 00 00       	call   801c8b <ipc_find_env>
  800e02:	a3 00 40 80 00       	mov    %eax,0x804000
  800e07:	83 c4 10             	add    $0x10,%esp
  800e0a:	eb c5                	jmp    800dd1 <fsipc+0x12>

00800e0c <devfile_trunc>:
}

// Truncate or extend an open file to 'size' bytes
static int
devfile_trunc(struct Fd *fd, off_t newsize)
{
  800e0c:	f3 0f 1e fb          	endbr32 
  800e10:	55                   	push   %ebp
  800e11:	89 e5                	mov    %esp,%ebp
  800e13:	83 ec 08             	sub    $0x8,%esp
	fsipcbuf.set_size.req_fileid = fd->fd_file.id;
  800e16:	8b 45 08             	mov    0x8(%ebp),%eax
  800e19:	8b 40 0c             	mov    0xc(%eax),%eax
  800e1c:	a3 00 50 80 00       	mov    %eax,0x805000
	fsipcbuf.set_size.req_size = newsize;
  800e21:	8b 45 0c             	mov    0xc(%ebp),%eax
  800e24:	a3 04 50 80 00       	mov    %eax,0x805004
	return fsipc(FSREQ_SET_SIZE, NULL);
  800e29:	ba 00 00 00 00       	mov    $0x0,%edx
  800e2e:	b8 02 00 00 00       	mov    $0x2,%eax
  800e33:	e8 87 ff ff ff       	call   800dbf <fsipc>
}
  800e38:	c9                   	leave  
  800e39:	c3                   	ret    

00800e3a <devfile_flush>:
{
  800e3a:	f3 0f 1e fb          	endbr32 
  800e3e:	55                   	push   %ebp
  800e3f:	89 e5                	mov    %esp,%ebp
  800e41:	83 ec 08             	sub    $0x8,%esp
	fsipcbuf.flush.req_fileid = fd->fd_file.id;
  800e44:	8b 45 08             	mov    0x8(%ebp),%eax
  800e47:	8b 40 0c             	mov    0xc(%eax),%eax
  800e4a:	a3 00 50 80 00       	mov    %eax,0x805000
	return fsipc(FSREQ_FLUSH, NULL);
  800e4f:	ba 00 00 00 00       	mov    $0x0,%edx
  800e54:	b8 06 00 00 00       	mov    $0x6,%eax
  800e59:	e8 61 ff ff ff       	call   800dbf <fsipc>
}
  800e5e:	c9                   	leave  
  800e5f:	c3                   	ret    

00800e60 <devfile_stat>:
{
  800e60:	f3 0f 1e fb          	endbr32 
  800e64:	55                   	push   %ebp
  800e65:	89 e5                	mov    %esp,%ebp
  800e67:	53                   	push   %ebx
  800e68:	83 ec 04             	sub    $0x4,%esp
  800e6b:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	fsipcbuf.stat.req_fileid = fd->fd_file.id;
  800e6e:	8b 45 08             	mov    0x8(%ebp),%eax
  800e71:	8b 40 0c             	mov    0xc(%eax),%eax
  800e74:	a3 00 50 80 00       	mov    %eax,0x805000
	if ((r = fsipc(FSREQ_STAT, NULL)) < 0)
  800e79:	ba 00 00 00 00       	mov    $0x0,%edx
  800e7e:	b8 05 00 00 00       	mov    $0x5,%eax
  800e83:	e8 37 ff ff ff       	call   800dbf <fsipc>
  800e88:	85 c0                	test   %eax,%eax
  800e8a:	78 2c                	js     800eb8 <devfile_stat+0x58>
	strcpy(st->st_name, fsipcbuf.statRet.ret_name);
  800e8c:	83 ec 08             	sub    $0x8,%esp
  800e8f:	68 00 50 80 00       	push   $0x805000
  800e94:	53                   	push   %ebx
  800e95:	e8 03 f3 ff ff       	call   80019d <strcpy>
	st->st_size = fsipcbuf.statRet.ret_size;
  800e9a:	a1 80 50 80 00       	mov    0x805080,%eax
  800e9f:	89 83 80 00 00 00    	mov    %eax,0x80(%ebx)
	st->st_isdir = fsipcbuf.statRet.ret_isdir;
  800ea5:	a1 84 50 80 00       	mov    0x805084,%eax
  800eaa:	89 83 84 00 00 00    	mov    %eax,0x84(%ebx)
	return 0;
  800eb0:	83 c4 10             	add    $0x10,%esp
  800eb3:	b8 00 00 00 00       	mov    $0x0,%eax
}
  800eb8:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  800ebb:	c9                   	leave  
  800ebc:	c3                   	ret    

00800ebd <devfile_write>:
{
  800ebd:	f3 0f 1e fb          	endbr32 
  800ec1:	55                   	push   %ebp
  800ec2:	89 e5                	mov    %esp,%ebp
  800ec4:	83 ec 0c             	sub    $0xc,%esp
  800ec7:	8b 45 10             	mov    0x10(%ebp),%eax
  800eca:	3d f8 0f 00 00       	cmp    $0xff8,%eax
  800ecf:	ba f8 0f 00 00       	mov    $0xff8,%edx
  800ed4:	0f 47 c2             	cmova  %edx,%eax
	fsipcbuf.write.req_fileid = fd->fd_file.id;
  800ed7:	8b 55 08             	mov    0x8(%ebp),%edx
  800eda:	8b 52 0c             	mov    0xc(%edx),%edx
  800edd:	89 15 00 50 80 00    	mov    %edx,0x805000
	fsipcbuf.write.req_n = n;
  800ee3:	a3 04 50 80 00       	mov    %eax,0x805004
	memmove(fsipcbuf.write.req_buf, buf, n);
  800ee8:	50                   	push   %eax
  800ee9:	ff 75 0c             	pushl  0xc(%ebp)
  800eec:	68 08 50 80 00       	push   $0x805008
  800ef1:	e8 5d f4 ff ff       	call   800353 <memmove>
	return fsipc(FSREQ_WRITE, NULL);}
  800ef6:	ba 00 00 00 00       	mov    $0x0,%edx
  800efb:	b8 04 00 00 00       	mov    $0x4,%eax
  800f00:	e8 ba fe ff ff       	call   800dbf <fsipc>
  800f05:	c9                   	leave  
  800f06:	c3                   	ret    

00800f07 <devfile_read>:
{
  800f07:	f3 0f 1e fb          	endbr32 
  800f0b:	55                   	push   %ebp
  800f0c:	89 e5                	mov    %esp,%ebp
  800f0e:	56                   	push   %esi
  800f0f:	53                   	push   %ebx
  800f10:	8b 75 10             	mov    0x10(%ebp),%esi
	fsipcbuf.read.req_fileid = fd->fd_file.id;
  800f13:	8b 45 08             	mov    0x8(%ebp),%eax
  800f16:	8b 40 0c             	mov    0xc(%eax),%eax
  800f19:	a3 00 50 80 00       	mov    %eax,0x805000
	fsipcbuf.read.req_n = n;
  800f1e:	89 35 04 50 80 00    	mov    %esi,0x805004
	if ((r = fsipc(FSREQ_READ, NULL)) < 0)
  800f24:	ba 00 00 00 00       	mov    $0x0,%edx
  800f29:	b8 03 00 00 00       	mov    $0x3,%eax
  800f2e:	e8 8c fe ff ff       	call   800dbf <fsipc>
  800f33:	89 c3                	mov    %eax,%ebx
  800f35:	85 c0                	test   %eax,%eax
  800f37:	78 1f                	js     800f58 <devfile_read+0x51>
	assert(r <= n);
  800f39:	39 f0                	cmp    %esi,%eax
  800f3b:	77 24                	ja     800f61 <devfile_read+0x5a>
	assert(r <= PGSIZE);
  800f3d:	3d 00 10 00 00       	cmp    $0x1000,%eax
  800f42:	7f 33                	jg     800f77 <devfile_read+0x70>
	memmove(buf, fsipcbuf.readRet.ret_buf, r);
  800f44:	83 ec 04             	sub    $0x4,%esp
  800f47:	50                   	push   %eax
  800f48:	68 00 50 80 00       	push   $0x805000
  800f4d:	ff 75 0c             	pushl  0xc(%ebp)
  800f50:	e8 fe f3 ff ff       	call   800353 <memmove>
	return r;
  800f55:	83 c4 10             	add    $0x10,%esp
}
  800f58:	89 d8                	mov    %ebx,%eax
  800f5a:	8d 65 f8             	lea    -0x8(%ebp),%esp
  800f5d:	5b                   	pop    %ebx
  800f5e:	5e                   	pop    %esi
  800f5f:	5d                   	pop    %ebp
  800f60:	c3                   	ret    
	assert(r <= n);
  800f61:	68 48 20 80 00       	push   $0x802048
  800f66:	68 4f 20 80 00       	push   $0x80204f
  800f6b:	6a 7c                	push   $0x7c
  800f6d:	68 64 20 80 00       	push   $0x802064
  800f72:	e8 be 05 00 00       	call   801535 <_panic>
	assert(r <= PGSIZE);
  800f77:	68 6f 20 80 00       	push   $0x80206f
  800f7c:	68 4f 20 80 00       	push   $0x80204f
  800f81:	6a 7d                	push   $0x7d
  800f83:	68 64 20 80 00       	push   $0x802064
  800f88:	e8 a8 05 00 00       	call   801535 <_panic>

00800f8d <open>:
{
  800f8d:	f3 0f 1e fb          	endbr32 
  800f91:	55                   	push   %ebp
  800f92:	89 e5                	mov    %esp,%ebp
  800f94:	56                   	push   %esi
  800f95:	53                   	push   %ebx
  800f96:	83 ec 1c             	sub    $0x1c,%esp
  800f99:	8b 75 08             	mov    0x8(%ebp),%esi
	if (strlen(path) >= MAXPATHLEN)
  800f9c:	56                   	push   %esi
  800f9d:	e8 b8 f1 ff ff       	call   80015a <strlen>
  800fa2:	83 c4 10             	add    $0x10,%esp
  800fa5:	3d ff 03 00 00       	cmp    $0x3ff,%eax
  800faa:	7f 6c                	jg     801018 <open+0x8b>
	if ((r = fd_alloc(&fd)) < 0)
  800fac:	83 ec 0c             	sub    $0xc,%esp
  800faf:	8d 45 f4             	lea    -0xc(%ebp),%eax
  800fb2:	50                   	push   %eax
  800fb3:	e8 67 f8 ff ff       	call   80081f <fd_alloc>
  800fb8:	89 c3                	mov    %eax,%ebx
  800fba:	83 c4 10             	add    $0x10,%esp
  800fbd:	85 c0                	test   %eax,%eax
  800fbf:	78 3c                	js     800ffd <open+0x70>
	strcpy(fsipcbuf.open.req_path, path);
  800fc1:	83 ec 08             	sub    $0x8,%esp
  800fc4:	56                   	push   %esi
  800fc5:	68 00 50 80 00       	push   $0x805000
  800fca:	e8 ce f1 ff ff       	call   80019d <strcpy>
	fsipcbuf.open.req_omode = mode;
  800fcf:	8b 45 0c             	mov    0xc(%ebp),%eax
  800fd2:	a3 00 54 80 00       	mov    %eax,0x805400
	if ((r = fsipc(FSREQ_OPEN, fd)) < 0) {
  800fd7:	8b 55 f4             	mov    -0xc(%ebp),%edx
  800fda:	b8 01 00 00 00       	mov    $0x1,%eax
  800fdf:	e8 db fd ff ff       	call   800dbf <fsipc>
  800fe4:	89 c3                	mov    %eax,%ebx
  800fe6:	83 c4 10             	add    $0x10,%esp
  800fe9:	85 c0                	test   %eax,%eax
  800feb:	78 19                	js     801006 <open+0x79>
	return fd2num(fd);
  800fed:	83 ec 0c             	sub    $0xc,%esp
  800ff0:	ff 75 f4             	pushl  -0xc(%ebp)
  800ff3:	e8 f8 f7 ff ff       	call   8007f0 <fd2num>
  800ff8:	89 c3                	mov    %eax,%ebx
  800ffa:	83 c4 10             	add    $0x10,%esp
}
  800ffd:	89 d8                	mov    %ebx,%eax
  800fff:	8d 65 f8             	lea    -0x8(%ebp),%esp
  801002:	5b                   	pop    %ebx
  801003:	5e                   	pop    %esi
  801004:	5d                   	pop    %ebp
  801005:	c3                   	ret    
		fd_close(fd, 0);
  801006:	83 ec 08             	sub    $0x8,%esp
  801009:	6a 00                	push   $0x0
  80100b:	ff 75 f4             	pushl  -0xc(%ebp)
  80100e:	e8 10 f9 ff ff       	call   800923 <fd_close>
		return r;
  801013:	83 c4 10             	add    $0x10,%esp
  801016:	eb e5                	jmp    800ffd <open+0x70>
		return -E_BAD_PATH;
  801018:	bb f4 ff ff ff       	mov    $0xfffffff4,%ebx
  80101d:	eb de                	jmp    800ffd <open+0x70>

0080101f <sync>:


// Synchronize disk with buffer cache
int
sync(void)
{
  80101f:	f3 0f 1e fb          	endbr32 
  801023:	55                   	push   %ebp
  801024:	89 e5                	mov    %esp,%ebp
  801026:	83 ec 08             	sub    $0x8,%esp
	// Ask the file server to update the disk
	// by writing any dirty blocks in the buffer cache.

	return fsipc(FSREQ_SYNC, NULL);
  801029:	ba 00 00 00 00       	mov    $0x0,%edx
  80102e:	b8 08 00 00 00       	mov    $0x8,%eax
  801033:	e8 87 fd ff ff       	call   800dbf <fsipc>
}
  801038:	c9                   	leave  
  801039:	c3                   	ret    

0080103a <devpipe_stat>:
	return i;
}

static int
devpipe_stat(struct Fd *fd, struct Stat *stat)
{
  80103a:	f3 0f 1e fb          	endbr32 
  80103e:	55                   	push   %ebp
  80103f:	89 e5                	mov    %esp,%ebp
  801041:	56                   	push   %esi
  801042:	53                   	push   %ebx
  801043:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	struct Pipe *p = (struct Pipe*) fd2data(fd);
  801046:	83 ec 0c             	sub    $0xc,%esp
  801049:	ff 75 08             	pushl  0x8(%ebp)
  80104c:	e8 b3 f7 ff ff       	call   800804 <fd2data>
  801051:	89 c6                	mov    %eax,%esi
	strcpy(stat->st_name, "<pipe>");
  801053:	83 c4 08             	add    $0x8,%esp
  801056:	68 7b 20 80 00       	push   $0x80207b
  80105b:	53                   	push   %ebx
  80105c:	e8 3c f1 ff ff       	call   80019d <strcpy>
	stat->st_size = p->p_wpos - p->p_rpos;
  801061:	8b 46 04             	mov    0x4(%esi),%eax
  801064:	2b 06                	sub    (%esi),%eax
  801066:	89 83 80 00 00 00    	mov    %eax,0x80(%ebx)
	stat->st_isdir = 0;
  80106c:	c7 83 84 00 00 00 00 	movl   $0x0,0x84(%ebx)
  801073:	00 00 00 
	stat->st_dev = &devpipe;
  801076:	c7 83 88 00 00 00 20 	movl   $0x803020,0x88(%ebx)
  80107d:	30 80 00 
	return 0;
}
  801080:	b8 00 00 00 00       	mov    $0x0,%eax
  801085:	8d 65 f8             	lea    -0x8(%ebp),%esp
  801088:	5b                   	pop    %ebx
  801089:	5e                   	pop    %esi
  80108a:	5d                   	pop    %ebp
  80108b:	c3                   	ret    

0080108c <devpipe_close>:

static int
devpipe_close(struct Fd *fd)
{
  80108c:	f3 0f 1e fb          	endbr32 
  801090:	55                   	push   %ebp
  801091:	89 e5                	mov    %esp,%ebp
  801093:	53                   	push   %ebx
  801094:	83 ec 0c             	sub    $0xc,%esp
  801097:	8b 5d 08             	mov    0x8(%ebp),%ebx
	(void) sys_page_unmap(0, fd);
  80109a:	53                   	push   %ebx
  80109b:	6a 00                	push   $0x0
  80109d:	e8 ca f5 ff ff       	call   80066c <sys_page_unmap>
	return sys_page_unmap(0, fd2data(fd));
  8010a2:	89 1c 24             	mov    %ebx,(%esp)
  8010a5:	e8 5a f7 ff ff       	call   800804 <fd2data>
  8010aa:	83 c4 08             	add    $0x8,%esp
  8010ad:	50                   	push   %eax
  8010ae:	6a 00                	push   $0x0
  8010b0:	e8 b7 f5 ff ff       	call   80066c <sys_page_unmap>
}
  8010b5:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  8010b8:	c9                   	leave  
  8010b9:	c3                   	ret    

008010ba <_pipeisclosed>:
{
  8010ba:	55                   	push   %ebp
  8010bb:	89 e5                	mov    %esp,%ebp
  8010bd:	57                   	push   %edi
  8010be:	56                   	push   %esi
  8010bf:	53                   	push   %ebx
  8010c0:	83 ec 1c             	sub    $0x1c,%esp
  8010c3:	89 c7                	mov    %eax,%edi
  8010c5:	89 d6                	mov    %edx,%esi
		n = thisenv->env_runs;
  8010c7:	a1 04 40 80 00       	mov    0x804004,%eax
  8010cc:	8b 58 58             	mov    0x58(%eax),%ebx
		ret = pageref(fd) == pageref(p);
  8010cf:	83 ec 0c             	sub    $0xc,%esp
  8010d2:	57                   	push   %edi
  8010d3:	e8 f0 0b 00 00       	call   801cc8 <pageref>
  8010d8:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  8010db:	89 34 24             	mov    %esi,(%esp)
  8010de:	e8 e5 0b 00 00       	call   801cc8 <pageref>
		nn = thisenv->env_runs;
  8010e3:	8b 15 04 40 80 00    	mov    0x804004,%edx
  8010e9:	8b 4a 58             	mov    0x58(%edx),%ecx
		if (n == nn)
  8010ec:	83 c4 10             	add    $0x10,%esp
  8010ef:	39 cb                	cmp    %ecx,%ebx
  8010f1:	74 1b                	je     80110e <_pipeisclosed+0x54>
		if (n != nn && ret == 1)
  8010f3:	39 45 e4             	cmp    %eax,-0x1c(%ebp)
  8010f6:	75 cf                	jne    8010c7 <_pipeisclosed+0xd>
			cprintf("pipe race avoided\n", n, thisenv->env_runs, ret);
  8010f8:	8b 42 58             	mov    0x58(%edx),%eax
  8010fb:	6a 01                	push   $0x1
  8010fd:	50                   	push   %eax
  8010fe:	53                   	push   %ebx
  8010ff:	68 82 20 80 00       	push   $0x802082
  801104:	e8 13 05 00 00       	call   80161c <cprintf>
  801109:	83 c4 10             	add    $0x10,%esp
  80110c:	eb b9                	jmp    8010c7 <_pipeisclosed+0xd>
		ret = pageref(fd) == pageref(p);
  80110e:	39 45 e4             	cmp    %eax,-0x1c(%ebp)
  801111:	0f 94 c0             	sete   %al
  801114:	0f b6 c0             	movzbl %al,%eax
}
  801117:	8d 65 f4             	lea    -0xc(%ebp),%esp
  80111a:	5b                   	pop    %ebx
  80111b:	5e                   	pop    %esi
  80111c:	5f                   	pop    %edi
  80111d:	5d                   	pop    %ebp
  80111e:	c3                   	ret    

0080111f <devpipe_write>:
{
  80111f:	f3 0f 1e fb          	endbr32 
  801123:	55                   	push   %ebp
  801124:	89 e5                	mov    %esp,%ebp
  801126:	57                   	push   %edi
  801127:	56                   	push   %esi
  801128:	53                   	push   %ebx
  801129:	83 ec 28             	sub    $0x28,%esp
  80112c:	8b 75 08             	mov    0x8(%ebp),%esi
	p = (struct Pipe*) fd2data(fd);
  80112f:	56                   	push   %esi
  801130:	e8 cf f6 ff ff       	call   800804 <fd2data>
  801135:	89 c3                	mov    %eax,%ebx
	for (i = 0; i < n; i++) {
  801137:	83 c4 10             	add    $0x10,%esp
  80113a:	bf 00 00 00 00       	mov    $0x0,%edi
  80113f:	3b 7d 10             	cmp    0x10(%ebp),%edi
  801142:	74 4f                	je     801193 <devpipe_write+0x74>
		while (p->p_wpos >= p->p_rpos + sizeof(p->p_buf)) {
  801144:	8b 43 04             	mov    0x4(%ebx),%eax
  801147:	8b 0b                	mov    (%ebx),%ecx
  801149:	8d 51 20             	lea    0x20(%ecx),%edx
  80114c:	39 d0                	cmp    %edx,%eax
  80114e:	72 14                	jb     801164 <devpipe_write+0x45>
			if (_pipeisclosed(fd, p))
  801150:	89 da                	mov    %ebx,%edx
  801152:	89 f0                	mov    %esi,%eax
  801154:	e8 61 ff ff ff       	call   8010ba <_pipeisclosed>
  801159:	85 c0                	test   %eax,%eax
  80115b:	75 3b                	jne    801198 <devpipe_write+0x79>
			sys_yield();
  80115d:	e8 5a f4 ff ff       	call   8005bc <sys_yield>
  801162:	eb e0                	jmp    801144 <devpipe_write+0x25>
		p->p_buf[p->p_wpos % PIPEBUFSIZ] = buf[i];
  801164:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  801167:	0f b6 0c 39          	movzbl (%ecx,%edi,1),%ecx
  80116b:	88 4d e7             	mov    %cl,-0x19(%ebp)
  80116e:	89 c2                	mov    %eax,%edx
  801170:	c1 fa 1f             	sar    $0x1f,%edx
  801173:	89 d1                	mov    %edx,%ecx
  801175:	c1 e9 1b             	shr    $0x1b,%ecx
  801178:	8d 14 08             	lea    (%eax,%ecx,1),%edx
  80117b:	83 e2 1f             	and    $0x1f,%edx
  80117e:	29 ca                	sub    %ecx,%edx
  801180:	0f b6 4d e7          	movzbl -0x19(%ebp),%ecx
  801184:	88 4c 13 08          	mov    %cl,0x8(%ebx,%edx,1)
		p->p_wpos++;
  801188:	83 c0 01             	add    $0x1,%eax
  80118b:	89 43 04             	mov    %eax,0x4(%ebx)
	for (i = 0; i < n; i++) {
  80118e:	83 c7 01             	add    $0x1,%edi
  801191:	eb ac                	jmp    80113f <devpipe_write+0x20>
	return i;
  801193:	8b 45 10             	mov    0x10(%ebp),%eax
  801196:	eb 05                	jmp    80119d <devpipe_write+0x7e>
				return 0;
  801198:	b8 00 00 00 00       	mov    $0x0,%eax
}
  80119d:	8d 65 f4             	lea    -0xc(%ebp),%esp
  8011a0:	5b                   	pop    %ebx
  8011a1:	5e                   	pop    %esi
  8011a2:	5f                   	pop    %edi
  8011a3:	5d                   	pop    %ebp
  8011a4:	c3                   	ret    

008011a5 <devpipe_read>:
{
  8011a5:	f3 0f 1e fb          	endbr32 
  8011a9:	55                   	push   %ebp
  8011aa:	89 e5                	mov    %esp,%ebp
  8011ac:	57                   	push   %edi
  8011ad:	56                   	push   %esi
  8011ae:	53                   	push   %ebx
  8011af:	83 ec 18             	sub    $0x18,%esp
  8011b2:	8b 7d 08             	mov    0x8(%ebp),%edi
	p = (struct Pipe*)fd2data(fd);
  8011b5:	57                   	push   %edi
  8011b6:	e8 49 f6 ff ff       	call   800804 <fd2data>
  8011bb:	89 c3                	mov    %eax,%ebx
	for (i = 0; i < n; i++) {
  8011bd:	83 c4 10             	add    $0x10,%esp
  8011c0:	be 00 00 00 00       	mov    $0x0,%esi
  8011c5:	3b 75 10             	cmp    0x10(%ebp),%esi
  8011c8:	75 14                	jne    8011de <devpipe_read+0x39>
	return i;
  8011ca:	8b 45 10             	mov    0x10(%ebp),%eax
  8011cd:	eb 02                	jmp    8011d1 <devpipe_read+0x2c>
				return i;
  8011cf:	89 f0                	mov    %esi,%eax
}
  8011d1:	8d 65 f4             	lea    -0xc(%ebp),%esp
  8011d4:	5b                   	pop    %ebx
  8011d5:	5e                   	pop    %esi
  8011d6:	5f                   	pop    %edi
  8011d7:	5d                   	pop    %ebp
  8011d8:	c3                   	ret    
			sys_yield();
  8011d9:	e8 de f3 ff ff       	call   8005bc <sys_yield>
		while (p->p_rpos == p->p_wpos) {
  8011de:	8b 03                	mov    (%ebx),%eax
  8011e0:	3b 43 04             	cmp    0x4(%ebx),%eax
  8011e3:	75 18                	jne    8011fd <devpipe_read+0x58>
			if (i > 0)
  8011e5:	85 f6                	test   %esi,%esi
  8011e7:	75 e6                	jne    8011cf <devpipe_read+0x2a>
			if (_pipeisclosed(fd, p))
  8011e9:	89 da                	mov    %ebx,%edx
  8011eb:	89 f8                	mov    %edi,%eax
  8011ed:	e8 c8 fe ff ff       	call   8010ba <_pipeisclosed>
  8011f2:	85 c0                	test   %eax,%eax
  8011f4:	74 e3                	je     8011d9 <devpipe_read+0x34>
				return 0;
  8011f6:	b8 00 00 00 00       	mov    $0x0,%eax
  8011fb:	eb d4                	jmp    8011d1 <devpipe_read+0x2c>
		buf[i] = p->p_buf[p->p_rpos % PIPEBUFSIZ];
  8011fd:	99                   	cltd   
  8011fe:	c1 ea 1b             	shr    $0x1b,%edx
  801201:	01 d0                	add    %edx,%eax
  801203:	83 e0 1f             	and    $0x1f,%eax
  801206:	29 d0                	sub    %edx,%eax
  801208:	0f b6 44 03 08       	movzbl 0x8(%ebx,%eax,1),%eax
  80120d:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  801210:	88 04 31             	mov    %al,(%ecx,%esi,1)
		p->p_rpos++;
  801213:	83 03 01             	addl   $0x1,(%ebx)
	for (i = 0; i < n; i++) {
  801216:	83 c6 01             	add    $0x1,%esi
  801219:	eb aa                	jmp    8011c5 <devpipe_read+0x20>

0080121b <pipe>:
{
  80121b:	f3 0f 1e fb          	endbr32 
  80121f:	55                   	push   %ebp
  801220:	89 e5                	mov    %esp,%ebp
  801222:	56                   	push   %esi
  801223:	53                   	push   %ebx
  801224:	83 ec 1c             	sub    $0x1c,%esp
	if ((r = fd_alloc(&fd0)) < 0
  801227:	8d 45 f4             	lea    -0xc(%ebp),%eax
  80122a:	50                   	push   %eax
  80122b:	e8 ef f5 ff ff       	call   80081f <fd_alloc>
  801230:	89 c3                	mov    %eax,%ebx
  801232:	83 c4 10             	add    $0x10,%esp
  801235:	85 c0                	test   %eax,%eax
  801237:	0f 88 23 01 00 00    	js     801360 <pipe+0x145>
	    || (r = sys_page_alloc(0, fd0, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  80123d:	83 ec 04             	sub    $0x4,%esp
  801240:	68 07 04 00 00       	push   $0x407
  801245:	ff 75 f4             	pushl  -0xc(%ebp)
  801248:	6a 00                	push   $0x0
  80124a:	e8 90 f3 ff ff       	call   8005df <sys_page_alloc>
  80124f:	89 c3                	mov    %eax,%ebx
  801251:	83 c4 10             	add    $0x10,%esp
  801254:	85 c0                	test   %eax,%eax
  801256:	0f 88 04 01 00 00    	js     801360 <pipe+0x145>
	if ((r = fd_alloc(&fd1)) < 0
  80125c:	83 ec 0c             	sub    $0xc,%esp
  80125f:	8d 45 f0             	lea    -0x10(%ebp),%eax
  801262:	50                   	push   %eax
  801263:	e8 b7 f5 ff ff       	call   80081f <fd_alloc>
  801268:	89 c3                	mov    %eax,%ebx
  80126a:	83 c4 10             	add    $0x10,%esp
  80126d:	85 c0                	test   %eax,%eax
  80126f:	0f 88 db 00 00 00    	js     801350 <pipe+0x135>
	    || (r = sys_page_alloc(0, fd1, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  801275:	83 ec 04             	sub    $0x4,%esp
  801278:	68 07 04 00 00       	push   $0x407
  80127d:	ff 75 f0             	pushl  -0x10(%ebp)
  801280:	6a 00                	push   $0x0
  801282:	e8 58 f3 ff ff       	call   8005df <sys_page_alloc>
  801287:	89 c3                	mov    %eax,%ebx
  801289:	83 c4 10             	add    $0x10,%esp
  80128c:	85 c0                	test   %eax,%eax
  80128e:	0f 88 bc 00 00 00    	js     801350 <pipe+0x135>
	va = fd2data(fd0);
  801294:	83 ec 0c             	sub    $0xc,%esp
  801297:	ff 75 f4             	pushl  -0xc(%ebp)
  80129a:	e8 65 f5 ff ff       	call   800804 <fd2data>
  80129f:	89 c6                	mov    %eax,%esi
	if ((r = sys_page_alloc(0, va, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  8012a1:	83 c4 0c             	add    $0xc,%esp
  8012a4:	68 07 04 00 00       	push   $0x407
  8012a9:	50                   	push   %eax
  8012aa:	6a 00                	push   $0x0
  8012ac:	e8 2e f3 ff ff       	call   8005df <sys_page_alloc>
  8012b1:	89 c3                	mov    %eax,%ebx
  8012b3:	83 c4 10             	add    $0x10,%esp
  8012b6:	85 c0                	test   %eax,%eax
  8012b8:	0f 88 82 00 00 00    	js     801340 <pipe+0x125>
	if ((r = sys_page_map(0, va, 0, fd2data(fd1), PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  8012be:	83 ec 0c             	sub    $0xc,%esp
  8012c1:	ff 75 f0             	pushl  -0x10(%ebp)
  8012c4:	e8 3b f5 ff ff       	call   800804 <fd2data>
  8012c9:	c7 04 24 07 04 00 00 	movl   $0x407,(%esp)
  8012d0:	50                   	push   %eax
  8012d1:	6a 00                	push   $0x0
  8012d3:	56                   	push   %esi
  8012d4:	6a 00                	push   $0x0
  8012d6:	e8 4b f3 ff ff       	call   800626 <sys_page_map>
  8012db:	89 c3                	mov    %eax,%ebx
  8012dd:	83 c4 20             	add    $0x20,%esp
  8012e0:	85 c0                	test   %eax,%eax
  8012e2:	78 4e                	js     801332 <pipe+0x117>
	fd0->fd_dev_id = devpipe.dev_id;
  8012e4:	a1 20 30 80 00       	mov    0x803020,%eax
  8012e9:	8b 55 f4             	mov    -0xc(%ebp),%edx
  8012ec:	89 02                	mov    %eax,(%edx)
	fd0->fd_omode = O_RDONLY;
  8012ee:	8b 55 f4             	mov    -0xc(%ebp),%edx
  8012f1:	c7 42 08 00 00 00 00 	movl   $0x0,0x8(%edx)
	fd1->fd_dev_id = devpipe.dev_id;
  8012f8:	8b 55 f0             	mov    -0x10(%ebp),%edx
  8012fb:	89 02                	mov    %eax,(%edx)
	fd1->fd_omode = O_WRONLY;
  8012fd:	8b 45 f0             	mov    -0x10(%ebp),%eax
  801300:	c7 40 08 01 00 00 00 	movl   $0x1,0x8(%eax)
	pfd[0] = fd2num(fd0);
  801307:	83 ec 0c             	sub    $0xc,%esp
  80130a:	ff 75 f4             	pushl  -0xc(%ebp)
  80130d:	e8 de f4 ff ff       	call   8007f0 <fd2num>
  801312:	8b 4d 08             	mov    0x8(%ebp),%ecx
  801315:	89 01                	mov    %eax,(%ecx)
	pfd[1] = fd2num(fd1);
  801317:	83 c4 04             	add    $0x4,%esp
  80131a:	ff 75 f0             	pushl  -0x10(%ebp)
  80131d:	e8 ce f4 ff ff       	call   8007f0 <fd2num>
  801322:	8b 4d 08             	mov    0x8(%ebp),%ecx
  801325:	89 41 04             	mov    %eax,0x4(%ecx)
	return 0;
  801328:	83 c4 10             	add    $0x10,%esp
  80132b:	bb 00 00 00 00       	mov    $0x0,%ebx
  801330:	eb 2e                	jmp    801360 <pipe+0x145>
	sys_page_unmap(0, va);
  801332:	83 ec 08             	sub    $0x8,%esp
  801335:	56                   	push   %esi
  801336:	6a 00                	push   $0x0
  801338:	e8 2f f3 ff ff       	call   80066c <sys_page_unmap>
  80133d:	83 c4 10             	add    $0x10,%esp
	sys_page_unmap(0, fd1);
  801340:	83 ec 08             	sub    $0x8,%esp
  801343:	ff 75 f0             	pushl  -0x10(%ebp)
  801346:	6a 00                	push   $0x0
  801348:	e8 1f f3 ff ff       	call   80066c <sys_page_unmap>
  80134d:	83 c4 10             	add    $0x10,%esp
	sys_page_unmap(0, fd0);
  801350:	83 ec 08             	sub    $0x8,%esp
  801353:	ff 75 f4             	pushl  -0xc(%ebp)
  801356:	6a 00                	push   $0x0
  801358:	e8 0f f3 ff ff       	call   80066c <sys_page_unmap>
  80135d:	83 c4 10             	add    $0x10,%esp
}
  801360:	89 d8                	mov    %ebx,%eax
  801362:	8d 65 f8             	lea    -0x8(%ebp),%esp
  801365:	5b                   	pop    %ebx
  801366:	5e                   	pop    %esi
  801367:	5d                   	pop    %ebp
  801368:	c3                   	ret    

00801369 <pipeisclosed>:
{
  801369:	f3 0f 1e fb          	endbr32 
  80136d:	55                   	push   %ebp
  80136e:	89 e5                	mov    %esp,%ebp
  801370:	83 ec 20             	sub    $0x20,%esp
	if ((r = fd_lookup(fdnum, &fd)) < 0)
  801373:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801376:	50                   	push   %eax
  801377:	ff 75 08             	pushl  0x8(%ebp)
  80137a:	e8 f6 f4 ff ff       	call   800875 <fd_lookup>
  80137f:	83 c4 10             	add    $0x10,%esp
  801382:	85 c0                	test   %eax,%eax
  801384:	78 18                	js     80139e <pipeisclosed+0x35>
	p = (struct Pipe*) fd2data(fd);
  801386:	83 ec 0c             	sub    $0xc,%esp
  801389:	ff 75 f4             	pushl  -0xc(%ebp)
  80138c:	e8 73 f4 ff ff       	call   800804 <fd2data>
  801391:	89 c2                	mov    %eax,%edx
	return _pipeisclosed(fd, p);
  801393:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801396:	e8 1f fd ff ff       	call   8010ba <_pipeisclosed>
  80139b:	83 c4 10             	add    $0x10,%esp
}
  80139e:	c9                   	leave  
  80139f:	c3                   	ret    

008013a0 <devcons_close>:
	return tot;
}

static int
devcons_close(struct Fd *fd)
{
  8013a0:	f3 0f 1e fb          	endbr32 
	USED(fd);

	return 0;
}
  8013a4:	b8 00 00 00 00       	mov    $0x0,%eax
  8013a9:	c3                   	ret    

008013aa <devcons_stat>:

static int
devcons_stat(struct Fd *fd, struct Stat *stat)
{
  8013aa:	f3 0f 1e fb          	endbr32 
  8013ae:	55                   	push   %ebp
  8013af:	89 e5                	mov    %esp,%ebp
  8013b1:	83 ec 10             	sub    $0x10,%esp
	strcpy(stat->st_name, "<cons>");
  8013b4:	68 9a 20 80 00       	push   $0x80209a
  8013b9:	ff 75 0c             	pushl  0xc(%ebp)
  8013bc:	e8 dc ed ff ff       	call   80019d <strcpy>
	return 0;
}
  8013c1:	b8 00 00 00 00       	mov    $0x0,%eax
  8013c6:	c9                   	leave  
  8013c7:	c3                   	ret    

008013c8 <devcons_write>:
{
  8013c8:	f3 0f 1e fb          	endbr32 
  8013cc:	55                   	push   %ebp
  8013cd:	89 e5                	mov    %esp,%ebp
  8013cf:	57                   	push   %edi
  8013d0:	56                   	push   %esi
  8013d1:	53                   	push   %ebx
  8013d2:	81 ec 8c 00 00 00    	sub    $0x8c,%esp
	for (tot = 0; tot < n; tot += m) {
  8013d8:	be 00 00 00 00       	mov    $0x0,%esi
		memmove(buf, (char*)vbuf + tot, m);
  8013dd:	8d bd 68 ff ff ff    	lea    -0x98(%ebp),%edi
	for (tot = 0; tot < n; tot += m) {
  8013e3:	3b 75 10             	cmp    0x10(%ebp),%esi
  8013e6:	73 31                	jae    801419 <devcons_write+0x51>
		m = n - tot;
  8013e8:	8b 5d 10             	mov    0x10(%ebp),%ebx
  8013eb:	29 f3                	sub    %esi,%ebx
  8013ed:	83 fb 7f             	cmp    $0x7f,%ebx
  8013f0:	b8 7f 00 00 00       	mov    $0x7f,%eax
  8013f5:	0f 47 d8             	cmova  %eax,%ebx
		memmove(buf, (char*)vbuf + tot, m);
  8013f8:	83 ec 04             	sub    $0x4,%esp
  8013fb:	53                   	push   %ebx
  8013fc:	89 f0                	mov    %esi,%eax
  8013fe:	03 45 0c             	add    0xc(%ebp),%eax
  801401:	50                   	push   %eax
  801402:	57                   	push   %edi
  801403:	e8 4b ef ff ff       	call   800353 <memmove>
		sys_cputs(buf, m);
  801408:	83 c4 08             	add    $0x8,%esp
  80140b:	53                   	push   %ebx
  80140c:	57                   	push   %edi
  80140d:	e8 fd f0 ff ff       	call   80050f <sys_cputs>
	for (tot = 0; tot < n; tot += m) {
  801412:	01 de                	add    %ebx,%esi
  801414:	83 c4 10             	add    $0x10,%esp
  801417:	eb ca                	jmp    8013e3 <devcons_write+0x1b>
}
  801419:	89 f0                	mov    %esi,%eax
  80141b:	8d 65 f4             	lea    -0xc(%ebp),%esp
  80141e:	5b                   	pop    %ebx
  80141f:	5e                   	pop    %esi
  801420:	5f                   	pop    %edi
  801421:	5d                   	pop    %ebp
  801422:	c3                   	ret    

00801423 <devcons_read>:
{
  801423:	f3 0f 1e fb          	endbr32 
  801427:	55                   	push   %ebp
  801428:	89 e5                	mov    %esp,%ebp
  80142a:	83 ec 08             	sub    $0x8,%esp
  80142d:	b8 00 00 00 00       	mov    $0x0,%eax
	if (n == 0)
  801432:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  801436:	74 21                	je     801459 <devcons_read+0x36>
	while ((c = sys_cgetc()) == 0)
  801438:	e8 f4 f0 ff ff       	call   800531 <sys_cgetc>
  80143d:	85 c0                	test   %eax,%eax
  80143f:	75 07                	jne    801448 <devcons_read+0x25>
		sys_yield();
  801441:	e8 76 f1 ff ff       	call   8005bc <sys_yield>
  801446:	eb f0                	jmp    801438 <devcons_read+0x15>
	if (c < 0)
  801448:	78 0f                	js     801459 <devcons_read+0x36>
	if (c == 0x04)	// ctl-d is eof
  80144a:	83 f8 04             	cmp    $0x4,%eax
  80144d:	74 0c                	je     80145b <devcons_read+0x38>
	*(char*)vbuf = c;
  80144f:	8b 55 0c             	mov    0xc(%ebp),%edx
  801452:	88 02                	mov    %al,(%edx)
	return 1;
  801454:	b8 01 00 00 00       	mov    $0x1,%eax
}
  801459:	c9                   	leave  
  80145a:	c3                   	ret    
		return 0;
  80145b:	b8 00 00 00 00       	mov    $0x0,%eax
  801460:	eb f7                	jmp    801459 <devcons_read+0x36>

00801462 <cputchar>:
{
  801462:	f3 0f 1e fb          	endbr32 
  801466:	55                   	push   %ebp
  801467:	89 e5                	mov    %esp,%ebp
  801469:	83 ec 20             	sub    $0x20,%esp
	char c = ch;
  80146c:	8b 45 08             	mov    0x8(%ebp),%eax
  80146f:	88 45 f7             	mov    %al,-0x9(%ebp)
	sys_cputs(&c, 1);
  801472:	6a 01                	push   $0x1
  801474:	8d 45 f7             	lea    -0x9(%ebp),%eax
  801477:	50                   	push   %eax
  801478:	e8 92 f0 ff ff       	call   80050f <sys_cputs>
}
  80147d:	83 c4 10             	add    $0x10,%esp
  801480:	c9                   	leave  
  801481:	c3                   	ret    

00801482 <getchar>:
{
  801482:	f3 0f 1e fb          	endbr32 
  801486:	55                   	push   %ebp
  801487:	89 e5                	mov    %esp,%ebp
  801489:	83 ec 1c             	sub    $0x1c,%esp
	r = read(0, &c, 1);
  80148c:	6a 01                	push   $0x1
  80148e:	8d 45 f7             	lea    -0x9(%ebp),%eax
  801491:	50                   	push   %eax
  801492:	6a 00                	push   $0x0
  801494:	e8 5f f6 ff ff       	call   800af8 <read>
	if (r < 0)
  801499:	83 c4 10             	add    $0x10,%esp
  80149c:	85 c0                	test   %eax,%eax
  80149e:	78 06                	js     8014a6 <getchar+0x24>
	if (r < 1)
  8014a0:	74 06                	je     8014a8 <getchar+0x26>
	return c;
  8014a2:	0f b6 45 f7          	movzbl -0x9(%ebp),%eax
}
  8014a6:	c9                   	leave  
  8014a7:	c3                   	ret    
		return -E_EOF;
  8014a8:	b8 f8 ff ff ff       	mov    $0xfffffff8,%eax
  8014ad:	eb f7                	jmp    8014a6 <getchar+0x24>

008014af <iscons>:
{
  8014af:	f3 0f 1e fb          	endbr32 
  8014b3:	55                   	push   %ebp
  8014b4:	89 e5                	mov    %esp,%ebp
  8014b6:	83 ec 20             	sub    $0x20,%esp
	if ((r = fd_lookup(fdnum, &fd)) < 0)
  8014b9:	8d 45 f4             	lea    -0xc(%ebp),%eax
  8014bc:	50                   	push   %eax
  8014bd:	ff 75 08             	pushl  0x8(%ebp)
  8014c0:	e8 b0 f3 ff ff       	call   800875 <fd_lookup>
  8014c5:	83 c4 10             	add    $0x10,%esp
  8014c8:	85 c0                	test   %eax,%eax
  8014ca:	78 11                	js     8014dd <iscons+0x2e>
	return fd->fd_dev_id == devcons.dev_id;
  8014cc:	8b 45 f4             	mov    -0xc(%ebp),%eax
  8014cf:	8b 15 3c 30 80 00    	mov    0x80303c,%edx
  8014d5:	39 10                	cmp    %edx,(%eax)
  8014d7:	0f 94 c0             	sete   %al
  8014da:	0f b6 c0             	movzbl %al,%eax
}
  8014dd:	c9                   	leave  
  8014de:	c3                   	ret    

008014df <opencons>:
{
  8014df:	f3 0f 1e fb          	endbr32 
  8014e3:	55                   	push   %ebp
  8014e4:	89 e5                	mov    %esp,%ebp
  8014e6:	83 ec 24             	sub    $0x24,%esp
	if ((r = fd_alloc(&fd)) < 0)
  8014e9:	8d 45 f4             	lea    -0xc(%ebp),%eax
  8014ec:	50                   	push   %eax
  8014ed:	e8 2d f3 ff ff       	call   80081f <fd_alloc>
  8014f2:	83 c4 10             	add    $0x10,%esp
  8014f5:	85 c0                	test   %eax,%eax
  8014f7:	78 3a                	js     801533 <opencons+0x54>
	if ((r = sys_page_alloc(0, fd, PTE_P|PTE_U|PTE_W|PTE_SHARE)) < 0)
  8014f9:	83 ec 04             	sub    $0x4,%esp
  8014fc:	68 07 04 00 00       	push   $0x407
  801501:	ff 75 f4             	pushl  -0xc(%ebp)
  801504:	6a 00                	push   $0x0
  801506:	e8 d4 f0 ff ff       	call   8005df <sys_page_alloc>
  80150b:	83 c4 10             	add    $0x10,%esp
  80150e:	85 c0                	test   %eax,%eax
  801510:	78 21                	js     801533 <opencons+0x54>
	fd->fd_dev_id = devcons.dev_id;
  801512:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801515:	8b 15 3c 30 80 00    	mov    0x80303c,%edx
  80151b:	89 10                	mov    %edx,(%eax)
	fd->fd_omode = O_RDWR;
  80151d:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801520:	c7 40 08 02 00 00 00 	movl   $0x2,0x8(%eax)
	return fd2num(fd);
  801527:	83 ec 0c             	sub    $0xc,%esp
  80152a:	50                   	push   %eax
  80152b:	e8 c0 f2 ff ff       	call   8007f0 <fd2num>
  801530:	83 c4 10             	add    $0x10,%esp
}
  801533:	c9                   	leave  
  801534:	c3                   	ret    

00801535 <_panic>:
 * It prints "panic: <message>", then causes a breakpoint exception,
 * which causes JOS to enter the JOS kernel monitor.
 */
void
_panic(const char *file, int line, const char *fmt, ...)
{
  801535:	f3 0f 1e fb          	endbr32 
  801539:	55                   	push   %ebp
  80153a:	89 e5                	mov    %esp,%ebp
  80153c:	56                   	push   %esi
  80153d:	53                   	push   %ebx
	va_list ap;

	va_start(ap, fmt);
  80153e:	8d 5d 14             	lea    0x14(%ebp),%ebx

	// Print the panic message
	cprintf("[%08x] user panic in %s at %s:%d: ",
  801541:	8b 35 00 30 80 00    	mov    0x803000,%esi
  801547:	e8 4d f0 ff ff       	call   800599 <sys_getenvid>
  80154c:	83 ec 0c             	sub    $0xc,%esp
  80154f:	ff 75 0c             	pushl  0xc(%ebp)
  801552:	ff 75 08             	pushl  0x8(%ebp)
  801555:	56                   	push   %esi
  801556:	50                   	push   %eax
  801557:	68 a8 20 80 00       	push   $0x8020a8
  80155c:	e8 bb 00 00 00       	call   80161c <cprintf>
		sys_getenvid(), binaryname, file, line);
	vcprintf(fmt, ap);
  801561:	83 c4 18             	add    $0x18,%esp
  801564:	53                   	push   %ebx
  801565:	ff 75 10             	pushl  0x10(%ebp)
  801568:	e8 5a 00 00 00       	call   8015c7 <vcprintf>
	cprintf("\n");
  80156d:	c7 04 24 93 20 80 00 	movl   $0x802093,(%esp)
  801574:	e8 a3 00 00 00       	call   80161c <cprintf>
  801579:	83 c4 10             	add    $0x10,%esp

	// Cause a breakpoint exception
	while (1)
		asm volatile("int3");
  80157c:	cc                   	int3   
  80157d:	eb fd                	jmp    80157c <_panic+0x47>

0080157f <putch>:
};


static void
putch(int ch, struct printbuf *b)
{
  80157f:	f3 0f 1e fb          	endbr32 
  801583:	55                   	push   %ebp
  801584:	89 e5                	mov    %esp,%ebp
  801586:	53                   	push   %ebx
  801587:	83 ec 04             	sub    $0x4,%esp
  80158a:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	b->buf[b->idx++] = ch;
  80158d:	8b 13                	mov    (%ebx),%edx
  80158f:	8d 42 01             	lea    0x1(%edx),%eax
  801592:	89 03                	mov    %eax,(%ebx)
  801594:	8b 4d 08             	mov    0x8(%ebp),%ecx
  801597:	88 4c 13 08          	mov    %cl,0x8(%ebx,%edx,1)
	if (b->idx == 256-1) {
  80159b:	3d ff 00 00 00       	cmp    $0xff,%eax
  8015a0:	74 09                	je     8015ab <putch+0x2c>
		sys_cputs(b->buf, b->idx);
		b->idx = 0;
	}
	b->cnt++;
  8015a2:	83 43 04 01          	addl   $0x1,0x4(%ebx)
}
  8015a6:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  8015a9:	c9                   	leave  
  8015aa:	c3                   	ret    
		sys_cputs(b->buf, b->idx);
  8015ab:	83 ec 08             	sub    $0x8,%esp
  8015ae:	68 ff 00 00 00       	push   $0xff
  8015b3:	8d 43 08             	lea    0x8(%ebx),%eax
  8015b6:	50                   	push   %eax
  8015b7:	e8 53 ef ff ff       	call   80050f <sys_cputs>
		b->idx = 0;
  8015bc:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
  8015c2:	83 c4 10             	add    $0x10,%esp
  8015c5:	eb db                	jmp    8015a2 <putch+0x23>

008015c7 <vcprintf>:

int
vcprintf(const char *fmt, va_list ap)
{
  8015c7:	f3 0f 1e fb          	endbr32 
  8015cb:	55                   	push   %ebp
  8015cc:	89 e5                	mov    %esp,%ebp
  8015ce:	81 ec 18 01 00 00    	sub    $0x118,%esp
	struct printbuf b;

	b.idx = 0;
  8015d4:	c7 85 f0 fe ff ff 00 	movl   $0x0,-0x110(%ebp)
  8015db:	00 00 00 
	b.cnt = 0;
  8015de:	c7 85 f4 fe ff ff 00 	movl   $0x0,-0x10c(%ebp)
  8015e5:	00 00 00 
	vprintfmt((void*)putch, &b, fmt, ap);
  8015e8:	ff 75 0c             	pushl  0xc(%ebp)
  8015eb:	ff 75 08             	pushl  0x8(%ebp)
  8015ee:	8d 85 f0 fe ff ff    	lea    -0x110(%ebp),%eax
  8015f4:	50                   	push   %eax
  8015f5:	68 7f 15 80 00       	push   $0x80157f
  8015fa:	e8 20 01 00 00       	call   80171f <vprintfmt>
	sys_cputs(b.buf, b.idx);
  8015ff:	83 c4 08             	add    $0x8,%esp
  801602:	ff b5 f0 fe ff ff    	pushl  -0x110(%ebp)
  801608:	8d 85 f8 fe ff ff    	lea    -0x108(%ebp),%eax
  80160e:	50                   	push   %eax
  80160f:	e8 fb ee ff ff       	call   80050f <sys_cputs>

	return b.cnt;
}
  801614:	8b 85 f4 fe ff ff    	mov    -0x10c(%ebp),%eax
  80161a:	c9                   	leave  
  80161b:	c3                   	ret    

0080161c <cprintf>:

int
cprintf(const char *fmt, ...)
{
  80161c:	f3 0f 1e fb          	endbr32 
  801620:	55                   	push   %ebp
  801621:	89 e5                	mov    %esp,%ebp
  801623:	83 ec 10             	sub    $0x10,%esp
	va_list ap;
	int cnt;

	va_start(ap, fmt);
  801626:	8d 45 0c             	lea    0xc(%ebp),%eax
	cnt = vcprintf(fmt, ap);
  801629:	50                   	push   %eax
  80162a:	ff 75 08             	pushl  0x8(%ebp)
  80162d:	e8 95 ff ff ff       	call   8015c7 <vcprintf>
	va_end(ap);

	return cnt;
}
  801632:	c9                   	leave  
  801633:	c3                   	ret    

00801634 <printnum>:
 * using specified putch function and associated pointer putdat.
 */
static void
printnum(void (*putch)(int, void*), void *putdat,
	 unsigned long long num, unsigned base, int width, int padc)
{
  801634:	55                   	push   %ebp
  801635:	89 e5                	mov    %esp,%ebp
  801637:	57                   	push   %edi
  801638:	56                   	push   %esi
  801639:	53                   	push   %ebx
  80163a:	83 ec 1c             	sub    $0x1c,%esp
  80163d:	89 c7                	mov    %eax,%edi
  80163f:	89 d6                	mov    %edx,%esi
  801641:	8b 45 08             	mov    0x8(%ebp),%eax
  801644:	8b 55 0c             	mov    0xc(%ebp),%edx
  801647:	89 d1                	mov    %edx,%ecx
  801649:	89 c2                	mov    %eax,%edx
  80164b:	89 45 d8             	mov    %eax,-0x28(%ebp)
  80164e:	89 4d dc             	mov    %ecx,-0x24(%ebp)
  801651:	8b 45 10             	mov    0x10(%ebp),%eax
  801654:	8b 5d 14             	mov    0x14(%ebp),%ebx
	// first recursively print all preceding (more significant) digits
	if (num >= base) {
  801657:	89 45 e0             	mov    %eax,-0x20(%ebp)
  80165a:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
  801661:	39 c2                	cmp    %eax,%edx
  801663:	1b 4d e4             	sbb    -0x1c(%ebp),%ecx
  801666:	72 3e                	jb     8016a6 <printnum+0x72>
		printnum(putch, putdat, num / base, base, width - 1, padc);
  801668:	83 ec 0c             	sub    $0xc,%esp
  80166b:	ff 75 18             	pushl  0x18(%ebp)
  80166e:	83 eb 01             	sub    $0x1,%ebx
  801671:	53                   	push   %ebx
  801672:	50                   	push   %eax
  801673:	83 ec 08             	sub    $0x8,%esp
  801676:	ff 75 e4             	pushl  -0x1c(%ebp)
  801679:	ff 75 e0             	pushl  -0x20(%ebp)
  80167c:	ff 75 dc             	pushl  -0x24(%ebp)
  80167f:	ff 75 d8             	pushl  -0x28(%ebp)
  801682:	e8 89 06 00 00       	call   801d10 <__udivdi3>
  801687:	83 c4 18             	add    $0x18,%esp
  80168a:	52                   	push   %edx
  80168b:	50                   	push   %eax
  80168c:	89 f2                	mov    %esi,%edx
  80168e:	89 f8                	mov    %edi,%eax
  801690:	e8 9f ff ff ff       	call   801634 <printnum>
  801695:	83 c4 20             	add    $0x20,%esp
  801698:	eb 13                	jmp    8016ad <printnum+0x79>
	} else {
		// print any needed pad characters before first digit
		while (--width > 0)
			putch(padc, putdat);
  80169a:	83 ec 08             	sub    $0x8,%esp
  80169d:	56                   	push   %esi
  80169e:	ff 75 18             	pushl  0x18(%ebp)
  8016a1:	ff d7                	call   *%edi
  8016a3:	83 c4 10             	add    $0x10,%esp
		while (--width > 0)
  8016a6:	83 eb 01             	sub    $0x1,%ebx
  8016a9:	85 db                	test   %ebx,%ebx
  8016ab:	7f ed                	jg     80169a <printnum+0x66>
	}

	// then print this (the least significant) digit
	putch("0123456789abcdef"[num % base], putdat);
  8016ad:	83 ec 08             	sub    $0x8,%esp
  8016b0:	56                   	push   %esi
  8016b1:	83 ec 04             	sub    $0x4,%esp
  8016b4:	ff 75 e4             	pushl  -0x1c(%ebp)
  8016b7:	ff 75 e0             	pushl  -0x20(%ebp)
  8016ba:	ff 75 dc             	pushl  -0x24(%ebp)
  8016bd:	ff 75 d8             	pushl  -0x28(%ebp)
  8016c0:	e8 5b 07 00 00       	call   801e20 <__umoddi3>
  8016c5:	83 c4 14             	add    $0x14,%esp
  8016c8:	0f be 80 cb 20 80 00 	movsbl 0x8020cb(%eax),%eax
  8016cf:	50                   	push   %eax
  8016d0:	ff d7                	call   *%edi
}
  8016d2:	83 c4 10             	add    $0x10,%esp
  8016d5:	8d 65 f4             	lea    -0xc(%ebp),%esp
  8016d8:	5b                   	pop    %ebx
  8016d9:	5e                   	pop    %esi
  8016da:	5f                   	pop    %edi
  8016db:	5d                   	pop    %ebp
  8016dc:	c3                   	ret    

008016dd <sprintputch>:
	int cnt;
};

static void
sprintputch(int ch, struct sprintbuf *b)
{
  8016dd:	f3 0f 1e fb          	endbr32 
  8016e1:	55                   	push   %ebp
  8016e2:	89 e5                	mov    %esp,%ebp
  8016e4:	8b 45 0c             	mov    0xc(%ebp),%eax
	b->cnt++;
  8016e7:	83 40 08 01          	addl   $0x1,0x8(%eax)
	if (b->buf < b->ebuf)
  8016eb:	8b 10                	mov    (%eax),%edx
  8016ed:	3b 50 04             	cmp    0x4(%eax),%edx
  8016f0:	73 0a                	jae    8016fc <sprintputch+0x1f>
		*b->buf++ = ch;
  8016f2:	8d 4a 01             	lea    0x1(%edx),%ecx
  8016f5:	89 08                	mov    %ecx,(%eax)
  8016f7:	8b 45 08             	mov    0x8(%ebp),%eax
  8016fa:	88 02                	mov    %al,(%edx)
}
  8016fc:	5d                   	pop    %ebp
  8016fd:	c3                   	ret    

008016fe <printfmt>:
{
  8016fe:	f3 0f 1e fb          	endbr32 
  801702:	55                   	push   %ebp
  801703:	89 e5                	mov    %esp,%ebp
  801705:	83 ec 08             	sub    $0x8,%esp
	va_start(ap, fmt);
  801708:	8d 45 14             	lea    0x14(%ebp),%eax
	vprintfmt(putch, putdat, fmt, ap);
  80170b:	50                   	push   %eax
  80170c:	ff 75 10             	pushl  0x10(%ebp)
  80170f:	ff 75 0c             	pushl  0xc(%ebp)
  801712:	ff 75 08             	pushl  0x8(%ebp)
  801715:	e8 05 00 00 00       	call   80171f <vprintfmt>
}
  80171a:	83 c4 10             	add    $0x10,%esp
  80171d:	c9                   	leave  
  80171e:	c3                   	ret    

0080171f <vprintfmt>:
{
  80171f:	f3 0f 1e fb          	endbr32 
  801723:	55                   	push   %ebp
  801724:	89 e5                	mov    %esp,%ebp
  801726:	57                   	push   %edi
  801727:	56                   	push   %esi
  801728:	53                   	push   %ebx
  801729:	83 ec 3c             	sub    $0x3c,%esp
  80172c:	8b 75 08             	mov    0x8(%ebp),%esi
  80172f:	8b 5d 0c             	mov    0xc(%ebp),%ebx
  801732:	8b 7d 10             	mov    0x10(%ebp),%edi
  801735:	e9 5d 03 00 00       	jmp    801a97 <vprintfmt+0x378>
		padc = ' ';
  80173a:	c6 45 d3 20          	movb   $0x20,-0x2d(%ebp)
		altflag = 0;
  80173e:	c7 45 e0 00 00 00 00 	movl   $0x0,-0x20(%ebp)
		precision = -1;
  801745:	c7 45 d8 ff ff ff ff 	movl   $0xffffffff,-0x28(%ebp)
		width = -1;
  80174c:	c7 45 d4 ff ff ff ff 	movl   $0xffffffff,-0x2c(%ebp)
		lflag = 0;
  801753:	b9 00 00 00 00       	mov    $0x0,%ecx
		switch (ch = *(unsigned char *) fmt++) {
  801758:	8d 47 01             	lea    0x1(%edi),%eax
  80175b:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  80175e:	0f b6 17             	movzbl (%edi),%edx
  801761:	8d 42 dd             	lea    -0x23(%edx),%eax
  801764:	3c 55                	cmp    $0x55,%al
  801766:	0f 87 ae 03 00 00    	ja     801b1a <vprintfmt+0x3fb>
  80176c:	0f b6 c0             	movzbl %al,%eax
  80176f:	3e ff 24 85 00 22 80 	notrack jmp *0x802200(,%eax,4)
  801776:	00 
  801777:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			padc = '-';
  80177a:	c6 45 d3 2d          	movb   $0x2d,-0x2d(%ebp)
  80177e:	eb d8                	jmp    801758 <vprintfmt+0x39>
		switch (ch = *(unsigned char *) fmt++) {
  801780:	8b 7d e4             	mov    -0x1c(%ebp),%edi
  801783:	c6 45 d3 30          	movb   $0x30,-0x2d(%ebp)
  801787:	eb cf                	jmp    801758 <vprintfmt+0x39>
  801789:	0f b6 d2             	movzbl %dl,%edx
  80178c:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			for (precision = 0; ; ++fmt) {
  80178f:	b8 00 00 00 00       	mov    $0x0,%eax
  801794:	89 4d e4             	mov    %ecx,-0x1c(%ebp)
				precision = precision * 10 + ch - '0';
  801797:	8d 04 80             	lea    (%eax,%eax,4),%eax
  80179a:	8d 44 42 d0          	lea    -0x30(%edx,%eax,2),%eax
				ch = *fmt;
  80179e:	0f be 17             	movsbl (%edi),%edx
				if (ch < '0' || ch > '9')
  8017a1:	8d 4a d0             	lea    -0x30(%edx),%ecx
  8017a4:	83 f9 09             	cmp    $0x9,%ecx
  8017a7:	77 55                	ja     8017fe <vprintfmt+0xdf>
			for (precision = 0; ; ++fmt) {
  8017a9:	83 c7 01             	add    $0x1,%edi
				precision = precision * 10 + ch - '0';
  8017ac:	eb e9                	jmp    801797 <vprintfmt+0x78>
			precision = va_arg(ap, int);
  8017ae:	8b 45 14             	mov    0x14(%ebp),%eax
  8017b1:	8b 00                	mov    (%eax),%eax
  8017b3:	89 45 d8             	mov    %eax,-0x28(%ebp)
  8017b6:	8b 45 14             	mov    0x14(%ebp),%eax
  8017b9:	8d 40 04             	lea    0x4(%eax),%eax
  8017bc:	89 45 14             	mov    %eax,0x14(%ebp)
		switch (ch = *(unsigned char *) fmt++) {
  8017bf:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			if (width < 0)
  8017c2:	83 7d d4 00          	cmpl   $0x0,-0x2c(%ebp)
  8017c6:	79 90                	jns    801758 <vprintfmt+0x39>
				width = precision, precision = -1;
  8017c8:	8b 45 d8             	mov    -0x28(%ebp),%eax
  8017cb:	89 45 d4             	mov    %eax,-0x2c(%ebp)
  8017ce:	c7 45 d8 ff ff ff ff 	movl   $0xffffffff,-0x28(%ebp)
  8017d5:	eb 81                	jmp    801758 <vprintfmt+0x39>
  8017d7:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  8017da:	85 c0                	test   %eax,%eax
  8017dc:	ba 00 00 00 00       	mov    $0x0,%edx
  8017e1:	0f 49 d0             	cmovns %eax,%edx
  8017e4:	89 55 d4             	mov    %edx,-0x2c(%ebp)
		switch (ch = *(unsigned char *) fmt++) {
  8017e7:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			goto reswitch;
  8017ea:	e9 69 ff ff ff       	jmp    801758 <vprintfmt+0x39>
		switch (ch = *(unsigned char *) fmt++) {
  8017ef:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			altflag = 1;
  8017f2:	c7 45 e0 01 00 00 00 	movl   $0x1,-0x20(%ebp)
			goto reswitch;
  8017f9:	e9 5a ff ff ff       	jmp    801758 <vprintfmt+0x39>
  8017fe:	8b 4d e4             	mov    -0x1c(%ebp),%ecx
  801801:	89 45 d8             	mov    %eax,-0x28(%ebp)
  801804:	eb bc                	jmp    8017c2 <vprintfmt+0xa3>
			lflag++;
  801806:	83 c1 01             	add    $0x1,%ecx
		switch (ch = *(unsigned char *) fmt++) {
  801809:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			goto reswitch;
  80180c:	e9 47 ff ff ff       	jmp    801758 <vprintfmt+0x39>
			putch(va_arg(ap, int), putdat);
  801811:	8b 45 14             	mov    0x14(%ebp),%eax
  801814:	8d 78 04             	lea    0x4(%eax),%edi
  801817:	83 ec 08             	sub    $0x8,%esp
  80181a:	53                   	push   %ebx
  80181b:	ff 30                	pushl  (%eax)
  80181d:	ff d6                	call   *%esi
			break;
  80181f:	83 c4 10             	add    $0x10,%esp
			putch(va_arg(ap, int), putdat);
  801822:	89 7d 14             	mov    %edi,0x14(%ebp)
			break;
  801825:	e9 6a 02 00 00       	jmp    801a94 <vprintfmt+0x375>
			err = va_arg(ap, int);
  80182a:	8b 45 14             	mov    0x14(%ebp),%eax
  80182d:	8d 78 04             	lea    0x4(%eax),%edi
  801830:	8b 00                	mov    (%eax),%eax
  801832:	99                   	cltd   
  801833:	31 d0                	xor    %edx,%eax
  801835:	29 d0                	sub    %edx,%eax
			if (err >= MAXERROR || (p = error_string[err]) == NULL)
  801837:	83 f8 0f             	cmp    $0xf,%eax
  80183a:	7f 23                	jg     80185f <vprintfmt+0x140>
  80183c:	8b 14 85 60 23 80 00 	mov    0x802360(,%eax,4),%edx
  801843:	85 d2                	test   %edx,%edx
  801845:	74 18                	je     80185f <vprintfmt+0x140>
				printfmt(putch, putdat, "%s", p);
  801847:	52                   	push   %edx
  801848:	68 61 20 80 00       	push   $0x802061
  80184d:	53                   	push   %ebx
  80184e:	56                   	push   %esi
  80184f:	e8 aa fe ff ff       	call   8016fe <printfmt>
  801854:	83 c4 10             	add    $0x10,%esp
			err = va_arg(ap, int);
  801857:	89 7d 14             	mov    %edi,0x14(%ebp)
  80185a:	e9 35 02 00 00       	jmp    801a94 <vprintfmt+0x375>
				printfmt(putch, putdat, "error %d", err);
  80185f:	50                   	push   %eax
  801860:	68 e3 20 80 00       	push   $0x8020e3
  801865:	53                   	push   %ebx
  801866:	56                   	push   %esi
  801867:	e8 92 fe ff ff       	call   8016fe <printfmt>
  80186c:	83 c4 10             	add    $0x10,%esp
			err = va_arg(ap, int);
  80186f:	89 7d 14             	mov    %edi,0x14(%ebp)
				printfmt(putch, putdat, "error %d", err);
  801872:	e9 1d 02 00 00       	jmp    801a94 <vprintfmt+0x375>
			if ((p = va_arg(ap, char *)) == NULL)
  801877:	8b 45 14             	mov    0x14(%ebp),%eax
  80187a:	83 c0 04             	add    $0x4,%eax
  80187d:	89 45 c8             	mov    %eax,-0x38(%ebp)
  801880:	8b 45 14             	mov    0x14(%ebp),%eax
  801883:	8b 10                	mov    (%eax),%edx
				p = "(null)";
  801885:	85 d2                	test   %edx,%edx
  801887:	b8 dc 20 80 00       	mov    $0x8020dc,%eax
  80188c:	0f 45 c2             	cmovne %edx,%eax
  80188f:	89 45 cc             	mov    %eax,-0x34(%ebp)
			if (width > 0 && padc != '-')
  801892:	83 7d d4 00          	cmpl   $0x0,-0x2c(%ebp)
  801896:	7e 06                	jle    80189e <vprintfmt+0x17f>
  801898:	80 7d d3 2d          	cmpb   $0x2d,-0x2d(%ebp)
  80189c:	75 0d                	jne    8018ab <vprintfmt+0x18c>
				for (width -= strnlen(p, precision); width > 0; width--)
  80189e:	8b 45 cc             	mov    -0x34(%ebp),%eax
  8018a1:	89 c7                	mov    %eax,%edi
  8018a3:	03 45 d4             	add    -0x2c(%ebp),%eax
  8018a6:	89 45 d4             	mov    %eax,-0x2c(%ebp)
  8018a9:	eb 55                	jmp    801900 <vprintfmt+0x1e1>
  8018ab:	83 ec 08             	sub    $0x8,%esp
  8018ae:	ff 75 d8             	pushl  -0x28(%ebp)
  8018b1:	ff 75 cc             	pushl  -0x34(%ebp)
  8018b4:	e8 bd e8 ff ff       	call   800176 <strnlen>
  8018b9:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  8018bc:	29 c2                	sub    %eax,%edx
  8018be:	89 55 c4             	mov    %edx,-0x3c(%ebp)
  8018c1:	83 c4 10             	add    $0x10,%esp
  8018c4:	89 d7                	mov    %edx,%edi
					putch(padc, putdat);
  8018c6:	0f be 45 d3          	movsbl -0x2d(%ebp),%eax
  8018ca:	89 45 d4             	mov    %eax,-0x2c(%ebp)
				for (width -= strnlen(p, precision); width > 0; width--)
  8018cd:	85 ff                	test   %edi,%edi
  8018cf:	7e 11                	jle    8018e2 <vprintfmt+0x1c3>
					putch(padc, putdat);
  8018d1:	83 ec 08             	sub    $0x8,%esp
  8018d4:	53                   	push   %ebx
  8018d5:	ff 75 d4             	pushl  -0x2c(%ebp)
  8018d8:	ff d6                	call   *%esi
				for (width -= strnlen(p, precision); width > 0; width--)
  8018da:	83 ef 01             	sub    $0x1,%edi
  8018dd:	83 c4 10             	add    $0x10,%esp
  8018e0:	eb eb                	jmp    8018cd <vprintfmt+0x1ae>
  8018e2:	8b 55 c4             	mov    -0x3c(%ebp),%edx
  8018e5:	85 d2                	test   %edx,%edx
  8018e7:	b8 00 00 00 00       	mov    $0x0,%eax
  8018ec:	0f 49 c2             	cmovns %edx,%eax
  8018ef:	29 c2                	sub    %eax,%edx
  8018f1:	89 55 d4             	mov    %edx,-0x2c(%ebp)
  8018f4:	eb a8                	jmp    80189e <vprintfmt+0x17f>
					putch(ch, putdat);
  8018f6:	83 ec 08             	sub    $0x8,%esp
  8018f9:	53                   	push   %ebx
  8018fa:	52                   	push   %edx
  8018fb:	ff d6                	call   *%esi
  8018fd:	83 c4 10             	add    $0x10,%esp
  801900:	8b 4d d4             	mov    -0x2c(%ebp),%ecx
  801903:	29 f9                	sub    %edi,%ecx
			for (; (ch = *p++) != '\0' && (precision < 0 || --precision >= 0); width--)
  801905:	83 c7 01             	add    $0x1,%edi
  801908:	0f b6 47 ff          	movzbl -0x1(%edi),%eax
  80190c:	0f be d0             	movsbl %al,%edx
  80190f:	85 d2                	test   %edx,%edx
  801911:	74 4b                	je     80195e <vprintfmt+0x23f>
  801913:	83 7d d8 00          	cmpl   $0x0,-0x28(%ebp)
  801917:	78 06                	js     80191f <vprintfmt+0x200>
  801919:	83 6d d8 01          	subl   $0x1,-0x28(%ebp)
  80191d:	78 1e                	js     80193d <vprintfmt+0x21e>
				if (altflag && (ch < ' ' || ch > '~'))
  80191f:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
  801923:	74 d1                	je     8018f6 <vprintfmt+0x1d7>
  801925:	0f be c0             	movsbl %al,%eax
  801928:	83 e8 20             	sub    $0x20,%eax
  80192b:	83 f8 5e             	cmp    $0x5e,%eax
  80192e:	76 c6                	jbe    8018f6 <vprintfmt+0x1d7>
					putch('?', putdat);
  801930:	83 ec 08             	sub    $0x8,%esp
  801933:	53                   	push   %ebx
  801934:	6a 3f                	push   $0x3f
  801936:	ff d6                	call   *%esi
  801938:	83 c4 10             	add    $0x10,%esp
  80193b:	eb c3                	jmp    801900 <vprintfmt+0x1e1>
  80193d:	89 cf                	mov    %ecx,%edi
  80193f:	eb 0e                	jmp    80194f <vprintfmt+0x230>
				putch(' ', putdat);
  801941:	83 ec 08             	sub    $0x8,%esp
  801944:	53                   	push   %ebx
  801945:	6a 20                	push   $0x20
  801947:	ff d6                	call   *%esi
			for (; width > 0; width--)
  801949:	83 ef 01             	sub    $0x1,%edi
  80194c:	83 c4 10             	add    $0x10,%esp
  80194f:	85 ff                	test   %edi,%edi
  801951:	7f ee                	jg     801941 <vprintfmt+0x222>
			if ((p = va_arg(ap, char *)) == NULL)
  801953:	8b 45 c8             	mov    -0x38(%ebp),%eax
  801956:	89 45 14             	mov    %eax,0x14(%ebp)
  801959:	e9 36 01 00 00       	jmp    801a94 <vprintfmt+0x375>
  80195e:	89 cf                	mov    %ecx,%edi
  801960:	eb ed                	jmp    80194f <vprintfmt+0x230>
	if (lflag >= 2)
  801962:	83 f9 01             	cmp    $0x1,%ecx
  801965:	7f 1f                	jg     801986 <vprintfmt+0x267>
	else if (lflag)
  801967:	85 c9                	test   %ecx,%ecx
  801969:	74 67                	je     8019d2 <vprintfmt+0x2b3>
		return va_arg(*ap, long);
  80196b:	8b 45 14             	mov    0x14(%ebp),%eax
  80196e:	8b 00                	mov    (%eax),%eax
  801970:	89 45 d8             	mov    %eax,-0x28(%ebp)
  801973:	89 c1                	mov    %eax,%ecx
  801975:	c1 f9 1f             	sar    $0x1f,%ecx
  801978:	89 4d dc             	mov    %ecx,-0x24(%ebp)
  80197b:	8b 45 14             	mov    0x14(%ebp),%eax
  80197e:	8d 40 04             	lea    0x4(%eax),%eax
  801981:	89 45 14             	mov    %eax,0x14(%ebp)
  801984:	eb 17                	jmp    80199d <vprintfmt+0x27e>
		return va_arg(*ap, long long);
  801986:	8b 45 14             	mov    0x14(%ebp),%eax
  801989:	8b 50 04             	mov    0x4(%eax),%edx
  80198c:	8b 00                	mov    (%eax),%eax
  80198e:	89 45 d8             	mov    %eax,-0x28(%ebp)
  801991:	89 55 dc             	mov    %edx,-0x24(%ebp)
  801994:	8b 45 14             	mov    0x14(%ebp),%eax
  801997:	8d 40 08             	lea    0x8(%eax),%eax
  80199a:	89 45 14             	mov    %eax,0x14(%ebp)
			if ((long long) num < 0) {
  80199d:	8b 55 d8             	mov    -0x28(%ebp),%edx
  8019a0:	8b 4d dc             	mov    -0x24(%ebp),%ecx
			base = 10;
  8019a3:	b8 0a 00 00 00       	mov    $0xa,%eax
			if ((long long) num < 0) {
  8019a8:	85 c9                	test   %ecx,%ecx
  8019aa:	0f 89 ca 00 00 00    	jns    801a7a <vprintfmt+0x35b>
				putch('-', putdat);
  8019b0:	83 ec 08             	sub    $0x8,%esp
  8019b3:	53                   	push   %ebx
  8019b4:	6a 2d                	push   $0x2d
  8019b6:	ff d6                	call   *%esi
				num = -(long long) num;
  8019b8:	8b 55 d8             	mov    -0x28(%ebp),%edx
  8019bb:	8b 4d dc             	mov    -0x24(%ebp),%ecx
  8019be:	f7 da                	neg    %edx
  8019c0:	83 d1 00             	adc    $0x0,%ecx
  8019c3:	f7 d9                	neg    %ecx
  8019c5:	83 c4 10             	add    $0x10,%esp
			base = 10;
  8019c8:	b8 0a 00 00 00       	mov    $0xa,%eax
  8019cd:	e9 a8 00 00 00       	jmp    801a7a <vprintfmt+0x35b>
		return va_arg(*ap, int);
  8019d2:	8b 45 14             	mov    0x14(%ebp),%eax
  8019d5:	8b 00                	mov    (%eax),%eax
  8019d7:	89 45 d8             	mov    %eax,-0x28(%ebp)
  8019da:	99                   	cltd   
  8019db:	89 55 dc             	mov    %edx,-0x24(%ebp)
  8019de:	8b 45 14             	mov    0x14(%ebp),%eax
  8019e1:	8d 40 04             	lea    0x4(%eax),%eax
  8019e4:	89 45 14             	mov    %eax,0x14(%ebp)
  8019e7:	eb b4                	jmp    80199d <vprintfmt+0x27e>
	if (lflag >= 2)
  8019e9:	83 f9 01             	cmp    $0x1,%ecx
  8019ec:	7f 1b                	jg     801a09 <vprintfmt+0x2ea>
	else if (lflag)
  8019ee:	85 c9                	test   %ecx,%ecx
  8019f0:	74 2c                	je     801a1e <vprintfmt+0x2ff>
		return va_arg(*ap, unsigned long);
  8019f2:	8b 45 14             	mov    0x14(%ebp),%eax
  8019f5:	8b 10                	mov    (%eax),%edx
  8019f7:	b9 00 00 00 00       	mov    $0x0,%ecx
  8019fc:	8d 40 04             	lea    0x4(%eax),%eax
  8019ff:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 10;
  801a02:	b8 0a 00 00 00       	mov    $0xa,%eax
		return va_arg(*ap, unsigned long);
  801a07:	eb 71                	jmp    801a7a <vprintfmt+0x35b>
		return va_arg(*ap, unsigned long long);
  801a09:	8b 45 14             	mov    0x14(%ebp),%eax
  801a0c:	8b 10                	mov    (%eax),%edx
  801a0e:	8b 48 04             	mov    0x4(%eax),%ecx
  801a11:	8d 40 08             	lea    0x8(%eax),%eax
  801a14:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 10;
  801a17:	b8 0a 00 00 00       	mov    $0xa,%eax
		return va_arg(*ap, unsigned long long);
  801a1c:	eb 5c                	jmp    801a7a <vprintfmt+0x35b>
		return va_arg(*ap, unsigned int);
  801a1e:	8b 45 14             	mov    0x14(%ebp),%eax
  801a21:	8b 10                	mov    (%eax),%edx
  801a23:	b9 00 00 00 00       	mov    $0x0,%ecx
  801a28:	8d 40 04             	lea    0x4(%eax),%eax
  801a2b:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 10;
  801a2e:	b8 0a 00 00 00       	mov    $0xa,%eax
		return va_arg(*ap, unsigned int);
  801a33:	eb 45                	jmp    801a7a <vprintfmt+0x35b>
			putch('X', putdat);
  801a35:	83 ec 08             	sub    $0x8,%esp
  801a38:	53                   	push   %ebx
  801a39:	6a 58                	push   $0x58
  801a3b:	ff d6                	call   *%esi
			putch('X', putdat);
  801a3d:	83 c4 08             	add    $0x8,%esp
  801a40:	53                   	push   %ebx
  801a41:	6a 58                	push   $0x58
  801a43:	ff d6                	call   *%esi
			putch('X', putdat);
  801a45:	83 c4 08             	add    $0x8,%esp
  801a48:	53                   	push   %ebx
  801a49:	6a 58                	push   $0x58
  801a4b:	ff d6                	call   *%esi
			break;
  801a4d:	83 c4 10             	add    $0x10,%esp
  801a50:	eb 42                	jmp    801a94 <vprintfmt+0x375>
			putch('0', putdat);
  801a52:	83 ec 08             	sub    $0x8,%esp
  801a55:	53                   	push   %ebx
  801a56:	6a 30                	push   $0x30
  801a58:	ff d6                	call   *%esi
			putch('x', putdat);
  801a5a:	83 c4 08             	add    $0x8,%esp
  801a5d:	53                   	push   %ebx
  801a5e:	6a 78                	push   $0x78
  801a60:	ff d6                	call   *%esi
			num = (unsigned long long)
  801a62:	8b 45 14             	mov    0x14(%ebp),%eax
  801a65:	8b 10                	mov    (%eax),%edx
  801a67:	b9 00 00 00 00       	mov    $0x0,%ecx
			goto number;
  801a6c:	83 c4 10             	add    $0x10,%esp
				(uintptr_t) va_arg(ap, void *);
  801a6f:	8d 40 04             	lea    0x4(%eax),%eax
  801a72:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  801a75:	b8 10 00 00 00       	mov    $0x10,%eax
			printnum(putch, putdat, num, base, width, padc);
  801a7a:	83 ec 0c             	sub    $0xc,%esp
  801a7d:	0f be 7d d3          	movsbl -0x2d(%ebp),%edi
  801a81:	57                   	push   %edi
  801a82:	ff 75 d4             	pushl  -0x2c(%ebp)
  801a85:	50                   	push   %eax
  801a86:	51                   	push   %ecx
  801a87:	52                   	push   %edx
  801a88:	89 da                	mov    %ebx,%edx
  801a8a:	89 f0                	mov    %esi,%eax
  801a8c:	e8 a3 fb ff ff       	call   801634 <printnum>
			break;
  801a91:	83 c4 20             	add    $0x20,%esp
			if ((p = va_arg(ap, char *)) == NULL)
  801a94:	8b 7d e4             	mov    -0x1c(%ebp),%edi
		while ((ch = *(unsigned char *) fmt++) != '%') {
  801a97:	83 c7 01             	add    $0x1,%edi
  801a9a:	0f b6 47 ff          	movzbl -0x1(%edi),%eax
  801a9e:	83 f8 25             	cmp    $0x25,%eax
  801aa1:	0f 84 93 fc ff ff    	je     80173a <vprintfmt+0x1b>
			if (ch == '\0')
  801aa7:	85 c0                	test   %eax,%eax
  801aa9:	0f 84 8b 00 00 00    	je     801b3a <vprintfmt+0x41b>
			putch(ch, putdat);
  801aaf:	83 ec 08             	sub    $0x8,%esp
  801ab2:	53                   	push   %ebx
  801ab3:	50                   	push   %eax
  801ab4:	ff d6                	call   *%esi
  801ab6:	83 c4 10             	add    $0x10,%esp
  801ab9:	eb dc                	jmp    801a97 <vprintfmt+0x378>
	if (lflag >= 2)
  801abb:	83 f9 01             	cmp    $0x1,%ecx
  801abe:	7f 1b                	jg     801adb <vprintfmt+0x3bc>
	else if (lflag)
  801ac0:	85 c9                	test   %ecx,%ecx
  801ac2:	74 2c                	je     801af0 <vprintfmt+0x3d1>
		return va_arg(*ap, unsigned long);
  801ac4:	8b 45 14             	mov    0x14(%ebp),%eax
  801ac7:	8b 10                	mov    (%eax),%edx
  801ac9:	b9 00 00 00 00       	mov    $0x0,%ecx
  801ace:	8d 40 04             	lea    0x4(%eax),%eax
  801ad1:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  801ad4:	b8 10 00 00 00       	mov    $0x10,%eax
		return va_arg(*ap, unsigned long);
  801ad9:	eb 9f                	jmp    801a7a <vprintfmt+0x35b>
		return va_arg(*ap, unsigned long long);
  801adb:	8b 45 14             	mov    0x14(%ebp),%eax
  801ade:	8b 10                	mov    (%eax),%edx
  801ae0:	8b 48 04             	mov    0x4(%eax),%ecx
  801ae3:	8d 40 08             	lea    0x8(%eax),%eax
  801ae6:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  801ae9:	b8 10 00 00 00       	mov    $0x10,%eax
		return va_arg(*ap, unsigned long long);
  801aee:	eb 8a                	jmp    801a7a <vprintfmt+0x35b>
		return va_arg(*ap, unsigned int);
  801af0:	8b 45 14             	mov    0x14(%ebp),%eax
  801af3:	8b 10                	mov    (%eax),%edx
  801af5:	b9 00 00 00 00       	mov    $0x0,%ecx
  801afa:	8d 40 04             	lea    0x4(%eax),%eax
  801afd:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  801b00:	b8 10 00 00 00       	mov    $0x10,%eax
		return va_arg(*ap, unsigned int);
  801b05:	e9 70 ff ff ff       	jmp    801a7a <vprintfmt+0x35b>
			putch(ch, putdat);
  801b0a:	83 ec 08             	sub    $0x8,%esp
  801b0d:	53                   	push   %ebx
  801b0e:	6a 25                	push   $0x25
  801b10:	ff d6                	call   *%esi
			break;
  801b12:	83 c4 10             	add    $0x10,%esp
  801b15:	e9 7a ff ff ff       	jmp    801a94 <vprintfmt+0x375>
			putch('%', putdat);
  801b1a:	83 ec 08             	sub    $0x8,%esp
  801b1d:	53                   	push   %ebx
  801b1e:	6a 25                	push   $0x25
  801b20:	ff d6                	call   *%esi
			for (fmt--; fmt[-1] != '%'; fmt--)
  801b22:	83 c4 10             	add    $0x10,%esp
  801b25:	89 f8                	mov    %edi,%eax
  801b27:	80 78 ff 25          	cmpb   $0x25,-0x1(%eax)
  801b2b:	74 05                	je     801b32 <vprintfmt+0x413>
  801b2d:	83 e8 01             	sub    $0x1,%eax
  801b30:	eb f5                	jmp    801b27 <vprintfmt+0x408>
  801b32:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  801b35:	e9 5a ff ff ff       	jmp    801a94 <vprintfmt+0x375>
}
  801b3a:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801b3d:	5b                   	pop    %ebx
  801b3e:	5e                   	pop    %esi
  801b3f:	5f                   	pop    %edi
  801b40:	5d                   	pop    %ebp
  801b41:	c3                   	ret    

00801b42 <vsnprintf>:

int
vsnprintf(char *buf, int n, const char *fmt, va_list ap)
{
  801b42:	f3 0f 1e fb          	endbr32 
  801b46:	55                   	push   %ebp
  801b47:	89 e5                	mov    %esp,%ebp
  801b49:	83 ec 18             	sub    $0x18,%esp
  801b4c:	8b 45 08             	mov    0x8(%ebp),%eax
  801b4f:	8b 55 0c             	mov    0xc(%ebp),%edx
	struct sprintbuf b = {buf, buf+n-1, 0};
  801b52:	89 45 ec             	mov    %eax,-0x14(%ebp)
  801b55:	8d 4c 10 ff          	lea    -0x1(%eax,%edx,1),%ecx
  801b59:	89 4d f0             	mov    %ecx,-0x10(%ebp)
  801b5c:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)

	if (buf == NULL || n < 1)
  801b63:	85 c0                	test   %eax,%eax
  801b65:	74 26                	je     801b8d <vsnprintf+0x4b>
  801b67:	85 d2                	test   %edx,%edx
  801b69:	7e 22                	jle    801b8d <vsnprintf+0x4b>
		return -E_INVAL;

	// print the string to the buffer
	vprintfmt((void*)sprintputch, &b, fmt, ap);
  801b6b:	ff 75 14             	pushl  0x14(%ebp)
  801b6e:	ff 75 10             	pushl  0x10(%ebp)
  801b71:	8d 45 ec             	lea    -0x14(%ebp),%eax
  801b74:	50                   	push   %eax
  801b75:	68 dd 16 80 00       	push   $0x8016dd
  801b7a:	e8 a0 fb ff ff       	call   80171f <vprintfmt>

	// null terminate the buffer
	*b.buf = '\0';
  801b7f:	8b 45 ec             	mov    -0x14(%ebp),%eax
  801b82:	c6 00 00             	movb   $0x0,(%eax)

	return b.cnt;
  801b85:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801b88:	83 c4 10             	add    $0x10,%esp
}
  801b8b:	c9                   	leave  
  801b8c:	c3                   	ret    
		return -E_INVAL;
  801b8d:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  801b92:	eb f7                	jmp    801b8b <vsnprintf+0x49>

00801b94 <snprintf>:

int
snprintf(char *buf, int n, const char *fmt, ...)
{
  801b94:	f3 0f 1e fb          	endbr32 
  801b98:	55                   	push   %ebp
  801b99:	89 e5                	mov    %esp,%ebp
  801b9b:	83 ec 08             	sub    $0x8,%esp
	va_list ap;
	int rc;

	va_start(ap, fmt);
  801b9e:	8d 45 14             	lea    0x14(%ebp),%eax
	rc = vsnprintf(buf, n, fmt, ap);
  801ba1:	50                   	push   %eax
  801ba2:	ff 75 10             	pushl  0x10(%ebp)
  801ba5:	ff 75 0c             	pushl  0xc(%ebp)
  801ba8:	ff 75 08             	pushl  0x8(%ebp)
  801bab:	e8 92 ff ff ff       	call   801b42 <vsnprintf>
	va_end(ap);

	return rc;
}
  801bb0:	c9                   	leave  
  801bb1:	c3                   	ret    

00801bb2 <ipc_recv>:
//   If 'pg' is null, pass sys_ipc_recv a value that it will understand
//   as meaning "no page".  (Zero is not the right value, since that's
//   a perfectly valid place to map a page.)
int32_t
ipc_recv(envid_t *from_env_store, void *pg, int *perm_store)
{
  801bb2:	f3 0f 1e fb          	endbr32 
  801bb6:	55                   	push   %ebp
  801bb7:	89 e5                	mov    %esp,%ebp
  801bb9:	56                   	push   %esi
  801bba:	53                   	push   %ebx
  801bbb:	8b 75 08             	mov    0x8(%ebp),%esi
  801bbe:	8b 45 0c             	mov    0xc(%ebp),%eax
  801bc1:	8b 5d 10             	mov    0x10(%ebp),%ebx
	// LAB 4: Your code here.
	int error;
	if(!pg)pg = (void *)UTOP; // 如果设置为UTOP，这个值其实可以比UTOP大，设置为这个值认为pg无效了，不会进行页面传递【共享页面的设置】，而是只进行值value的传递。
  801bc4:	85 c0                	test   %eax,%eax
  801bc6:	ba 00 00 c0 ee       	mov    $0xeec00000,%edx
  801bcb:	0f 44 c2             	cmove  %edx,%eax
	if((error = sys_ipc_recv(pg)) < 0){
  801bce:	83 ec 0c             	sub    $0xc,%esp
  801bd1:	50                   	push   %eax
  801bd2:	e8 d4 eb ff ff       	call   8007ab <sys_ipc_recv>
  801bd7:	83 c4 10             	add    $0x10,%esp
  801bda:	85 c0                	test   %eax,%eax
  801bdc:	78 3f                	js     801c1d <ipc_recv+0x6b>
		if(from_env_store)*from_env_store = 0;
		if(perm_store)*perm_store = 0;
		return error;
	}

	thisenv = &envs[ENVX(sys_getenvid())]; // for lab4's challenge sfork().
  801bde:	e8 b6 e9 ff ff       	call   800599 <sys_getenvid>
  801be3:	25 ff 03 00 00       	and    $0x3ff,%eax
  801be8:	6b d0 7c             	imul   $0x7c,%eax,%edx
  801beb:	81 c2 00 00 c0 ee    	add    $0xeec00000,%edx
  801bf1:	89 15 04 40 80 00    	mov    %edx,0x804004

	if(from_env_store)*from_env_store = thisenv->env_ipc_from;
  801bf7:	85 f6                	test   %esi,%esi
  801bf9:	74 05                	je     801c00 <ipc_recv+0x4e>
  801bfb:	8b 42 74             	mov    0x74(%edx),%eax
  801bfe:	89 06                	mov    %eax,(%esi)
	if(perm_store)*perm_store = thisenv->env_ipc_perm;
  801c00:	85 db                	test   %ebx,%ebx
  801c02:	74 0a                	je     801c0e <ipc_recv+0x5c>
  801c04:	a1 04 40 80 00       	mov    0x804004,%eax
  801c09:	8b 40 78             	mov    0x78(%eax),%eax
  801c0c:	89 03                	mov    %eax,(%ebx)
	return thisenv->env_ipc_value;
  801c0e:	a1 04 40 80 00       	mov    0x804004,%eax
  801c13:	8b 40 70             	mov    0x70(%eax),%eax
}
  801c16:	8d 65 f8             	lea    -0x8(%ebp),%esp
  801c19:	5b                   	pop    %ebx
  801c1a:	5e                   	pop    %esi
  801c1b:	5d                   	pop    %ebp
  801c1c:	c3                   	ret    
		if(from_env_store)*from_env_store = 0;
  801c1d:	85 f6                	test   %esi,%esi
  801c1f:	74 06                	je     801c27 <ipc_recv+0x75>
  801c21:	c7 06 00 00 00 00    	movl   $0x0,(%esi)
		if(perm_store)*perm_store = 0;
  801c27:	85 db                	test   %ebx,%ebx
  801c29:	74 eb                	je     801c16 <ipc_recv+0x64>
  801c2b:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
  801c31:	eb e3                	jmp    801c16 <ipc_recv+0x64>

00801c33 <ipc_send>:
//   Use sys_yield() to be CPU-friendly.
//   If 'pg' is null, pass sys_ipc_try_send a value that it will understand
//   as meaning "no page".  (Zero is not the right value.)
void
ipc_send(envid_t to_env, uint32_t val, void *pg, int perm)
{
  801c33:	f3 0f 1e fb          	endbr32 
  801c37:	55                   	push   %ebp
  801c38:	89 e5                	mov    %esp,%ebp
  801c3a:	57                   	push   %edi
  801c3b:	56                   	push   %esi
  801c3c:	53                   	push   %ebx
  801c3d:	83 ec 0c             	sub    $0xc,%esp
  801c40:	8b 7d 08             	mov    0x8(%ebp),%edi
  801c43:	8b 75 0c             	mov    0xc(%ebp),%esi
  801c46:	8b 5d 10             	mov    0x10(%ebp),%ebx
	// LAB 4: Your code here.
	if(!pg)pg = (void *)UTOP; // 不会进行页面共享，只会sending message。
  801c49:	85 db                	test   %ebx,%ebx
  801c4b:	b8 00 00 c0 ee       	mov    $0xeec00000,%eax
  801c50:	0f 44 d8             	cmove  %eax,%ebx
	int error;
	// Keep trying until it succeeds.
	while((error = sys_ipc_try_send(to_env, val, pg, perm)) < 0){
  801c53:	ff 75 14             	pushl  0x14(%ebp)
  801c56:	53                   	push   %ebx
  801c57:	56                   	push   %esi
  801c58:	57                   	push   %edi
  801c59:	e8 26 eb ff ff       	call   800784 <sys_ipc_try_send>
  801c5e:	83 c4 10             	add    $0x10,%esp
  801c61:	85 c0                	test   %eax,%eax
  801c63:	79 1e                	jns    801c83 <ipc_send+0x50>
        //如果error是没有接收者，那么就会继续尝试send
		if(error != -E_IPC_NOT_RECV){
  801c65:	83 f8 f9             	cmp    $0xfffffff9,%eax
  801c68:	75 07                	jne    801c71 <ipc_send+0x3e>
			panic("sys_ipc_try_send:%e", error);
		}
        //但是不是一味的占用cpu，而是尝试一次就释放CPU，等待再次被调度，才会重新send，寻找receiver。
		sys_yield(); // To be CPU-friendly.
  801c6a:	e8 4d e9 ff ff       	call   8005bc <sys_yield>
  801c6f:	eb e2                	jmp    801c53 <ipc_send+0x20>
			panic("sys_ipc_try_send:%e", error);
  801c71:	50                   	push   %eax
  801c72:	68 bf 23 80 00       	push   $0x8023bf
  801c77:	6a 3b                	push   $0x3b
  801c79:	68 d3 23 80 00       	push   $0x8023d3
  801c7e:	e8 b2 f8 ff ff       	call   801535 <_panic>
	}
}
  801c83:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801c86:	5b                   	pop    %ebx
  801c87:	5e                   	pop    %esi
  801c88:	5f                   	pop    %edi
  801c89:	5d                   	pop    %ebp
  801c8a:	c3                   	ret    

00801c8b <ipc_find_env>:
// Find the first environment of the given type.  We'll use this to
// find special environments.
// Returns 0 if no such environment exists.
envid_t
ipc_find_env(enum EnvType type)
{
  801c8b:	f3 0f 1e fb          	endbr32 
  801c8f:	55                   	push   %ebp
  801c90:	89 e5                	mov    %esp,%ebp
  801c92:	8b 4d 08             	mov    0x8(%ebp),%ecx
	int i;
	for (i = 0; i < NENV; i++)
  801c95:	b8 00 00 00 00       	mov    $0x0,%eax
		if (envs[i].env_type == type)
  801c9a:	6b d0 7c             	imul   $0x7c,%eax,%edx
  801c9d:	81 c2 00 00 c0 ee    	add    $0xeec00000,%edx
  801ca3:	8b 52 50             	mov    0x50(%edx),%edx
  801ca6:	39 ca                	cmp    %ecx,%edx
  801ca8:	74 11                	je     801cbb <ipc_find_env+0x30>
	for (i = 0; i < NENV; i++)
  801caa:	83 c0 01             	add    $0x1,%eax
  801cad:	3d 00 04 00 00       	cmp    $0x400,%eax
  801cb2:	75 e6                	jne    801c9a <ipc_find_env+0xf>
			return envs[i].env_id;
	return 0;
  801cb4:	b8 00 00 00 00       	mov    $0x0,%eax
  801cb9:	eb 0b                	jmp    801cc6 <ipc_find_env+0x3b>
			return envs[i].env_id;
  801cbb:	6b c0 7c             	imul   $0x7c,%eax,%eax
  801cbe:	05 00 00 c0 ee       	add    $0xeec00000,%eax
  801cc3:	8b 40 48             	mov    0x48(%eax),%eax
}
  801cc6:	5d                   	pop    %ebp
  801cc7:	c3                   	ret    

00801cc8 <pageref>:
#include <inc/lib.h>

int
pageref(void *v)
{
  801cc8:	f3 0f 1e fb          	endbr32 
  801ccc:	55                   	push   %ebp
  801ccd:	89 e5                	mov    %esp,%ebp
  801ccf:	8b 45 08             	mov    0x8(%ebp),%eax
	pte_t pte;

	if (!(uvpd[PDX(v)] & PTE_P))
  801cd2:	89 c2                	mov    %eax,%edx
  801cd4:	c1 ea 16             	shr    $0x16,%edx
  801cd7:	8b 0c 95 00 d0 7b ef 	mov    -0x10843000(,%edx,4),%ecx
		return 0;
  801cde:	ba 00 00 00 00       	mov    $0x0,%edx
	if (!(uvpd[PDX(v)] & PTE_P))
  801ce3:	f6 c1 01             	test   $0x1,%cl
  801ce6:	74 1c                	je     801d04 <pageref+0x3c>
	pte = uvpt[PGNUM(v)];
  801ce8:	c1 e8 0c             	shr    $0xc,%eax
  801ceb:	8b 04 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%eax
	if (!(pte & PTE_P))
  801cf2:	a8 01                	test   $0x1,%al
  801cf4:	74 0e                	je     801d04 <pageref+0x3c>
		return 0;
	return pages[PGNUM(pte)].pp_ref;
  801cf6:	c1 e8 0c             	shr    $0xc,%eax
  801cf9:	0f b7 14 c5 04 00 00 	movzwl -0x10fffffc(,%eax,8),%edx
  801d00:	ef 
  801d01:	0f b7 d2             	movzwl %dx,%edx
}
  801d04:	89 d0                	mov    %edx,%eax
  801d06:	5d                   	pop    %ebp
  801d07:	c3                   	ret    
  801d08:	66 90                	xchg   %ax,%ax
  801d0a:	66 90                	xchg   %ax,%ax
  801d0c:	66 90                	xchg   %ax,%ax
  801d0e:	66 90                	xchg   %ax,%ax

00801d10 <__udivdi3>:
  801d10:	f3 0f 1e fb          	endbr32 
  801d14:	55                   	push   %ebp
  801d15:	57                   	push   %edi
  801d16:	56                   	push   %esi
  801d17:	53                   	push   %ebx
  801d18:	83 ec 1c             	sub    $0x1c,%esp
  801d1b:	8b 54 24 3c          	mov    0x3c(%esp),%edx
  801d1f:	8b 6c 24 30          	mov    0x30(%esp),%ebp
  801d23:	8b 74 24 34          	mov    0x34(%esp),%esi
  801d27:	8b 5c 24 38          	mov    0x38(%esp),%ebx
  801d2b:	85 d2                	test   %edx,%edx
  801d2d:	75 19                	jne    801d48 <__udivdi3+0x38>
  801d2f:	39 f3                	cmp    %esi,%ebx
  801d31:	76 4d                	jbe    801d80 <__udivdi3+0x70>
  801d33:	31 ff                	xor    %edi,%edi
  801d35:	89 e8                	mov    %ebp,%eax
  801d37:	89 f2                	mov    %esi,%edx
  801d39:	f7 f3                	div    %ebx
  801d3b:	89 fa                	mov    %edi,%edx
  801d3d:	83 c4 1c             	add    $0x1c,%esp
  801d40:	5b                   	pop    %ebx
  801d41:	5e                   	pop    %esi
  801d42:	5f                   	pop    %edi
  801d43:	5d                   	pop    %ebp
  801d44:	c3                   	ret    
  801d45:	8d 76 00             	lea    0x0(%esi),%esi
  801d48:	39 f2                	cmp    %esi,%edx
  801d4a:	76 14                	jbe    801d60 <__udivdi3+0x50>
  801d4c:	31 ff                	xor    %edi,%edi
  801d4e:	31 c0                	xor    %eax,%eax
  801d50:	89 fa                	mov    %edi,%edx
  801d52:	83 c4 1c             	add    $0x1c,%esp
  801d55:	5b                   	pop    %ebx
  801d56:	5e                   	pop    %esi
  801d57:	5f                   	pop    %edi
  801d58:	5d                   	pop    %ebp
  801d59:	c3                   	ret    
  801d5a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  801d60:	0f bd fa             	bsr    %edx,%edi
  801d63:	83 f7 1f             	xor    $0x1f,%edi
  801d66:	75 48                	jne    801db0 <__udivdi3+0xa0>
  801d68:	39 f2                	cmp    %esi,%edx
  801d6a:	72 06                	jb     801d72 <__udivdi3+0x62>
  801d6c:	31 c0                	xor    %eax,%eax
  801d6e:	39 eb                	cmp    %ebp,%ebx
  801d70:	77 de                	ja     801d50 <__udivdi3+0x40>
  801d72:	b8 01 00 00 00       	mov    $0x1,%eax
  801d77:	eb d7                	jmp    801d50 <__udivdi3+0x40>
  801d79:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801d80:	89 d9                	mov    %ebx,%ecx
  801d82:	85 db                	test   %ebx,%ebx
  801d84:	75 0b                	jne    801d91 <__udivdi3+0x81>
  801d86:	b8 01 00 00 00       	mov    $0x1,%eax
  801d8b:	31 d2                	xor    %edx,%edx
  801d8d:	f7 f3                	div    %ebx
  801d8f:	89 c1                	mov    %eax,%ecx
  801d91:	31 d2                	xor    %edx,%edx
  801d93:	89 f0                	mov    %esi,%eax
  801d95:	f7 f1                	div    %ecx
  801d97:	89 c6                	mov    %eax,%esi
  801d99:	89 e8                	mov    %ebp,%eax
  801d9b:	89 f7                	mov    %esi,%edi
  801d9d:	f7 f1                	div    %ecx
  801d9f:	89 fa                	mov    %edi,%edx
  801da1:	83 c4 1c             	add    $0x1c,%esp
  801da4:	5b                   	pop    %ebx
  801da5:	5e                   	pop    %esi
  801da6:	5f                   	pop    %edi
  801da7:	5d                   	pop    %ebp
  801da8:	c3                   	ret    
  801da9:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801db0:	89 f9                	mov    %edi,%ecx
  801db2:	b8 20 00 00 00       	mov    $0x20,%eax
  801db7:	29 f8                	sub    %edi,%eax
  801db9:	d3 e2                	shl    %cl,%edx
  801dbb:	89 54 24 08          	mov    %edx,0x8(%esp)
  801dbf:	89 c1                	mov    %eax,%ecx
  801dc1:	89 da                	mov    %ebx,%edx
  801dc3:	d3 ea                	shr    %cl,%edx
  801dc5:	8b 4c 24 08          	mov    0x8(%esp),%ecx
  801dc9:	09 d1                	or     %edx,%ecx
  801dcb:	89 f2                	mov    %esi,%edx
  801dcd:	89 4c 24 08          	mov    %ecx,0x8(%esp)
  801dd1:	89 f9                	mov    %edi,%ecx
  801dd3:	d3 e3                	shl    %cl,%ebx
  801dd5:	89 c1                	mov    %eax,%ecx
  801dd7:	d3 ea                	shr    %cl,%edx
  801dd9:	89 f9                	mov    %edi,%ecx
  801ddb:	89 5c 24 0c          	mov    %ebx,0xc(%esp)
  801ddf:	89 eb                	mov    %ebp,%ebx
  801de1:	d3 e6                	shl    %cl,%esi
  801de3:	89 c1                	mov    %eax,%ecx
  801de5:	d3 eb                	shr    %cl,%ebx
  801de7:	09 de                	or     %ebx,%esi
  801de9:	89 f0                	mov    %esi,%eax
  801deb:	f7 74 24 08          	divl   0x8(%esp)
  801def:	89 d6                	mov    %edx,%esi
  801df1:	89 c3                	mov    %eax,%ebx
  801df3:	f7 64 24 0c          	mull   0xc(%esp)
  801df7:	39 d6                	cmp    %edx,%esi
  801df9:	72 15                	jb     801e10 <__udivdi3+0x100>
  801dfb:	89 f9                	mov    %edi,%ecx
  801dfd:	d3 e5                	shl    %cl,%ebp
  801dff:	39 c5                	cmp    %eax,%ebp
  801e01:	73 04                	jae    801e07 <__udivdi3+0xf7>
  801e03:	39 d6                	cmp    %edx,%esi
  801e05:	74 09                	je     801e10 <__udivdi3+0x100>
  801e07:	89 d8                	mov    %ebx,%eax
  801e09:	31 ff                	xor    %edi,%edi
  801e0b:	e9 40 ff ff ff       	jmp    801d50 <__udivdi3+0x40>
  801e10:	8d 43 ff             	lea    -0x1(%ebx),%eax
  801e13:	31 ff                	xor    %edi,%edi
  801e15:	e9 36 ff ff ff       	jmp    801d50 <__udivdi3+0x40>
  801e1a:	66 90                	xchg   %ax,%ax
  801e1c:	66 90                	xchg   %ax,%ax
  801e1e:	66 90                	xchg   %ax,%ax

00801e20 <__umoddi3>:
  801e20:	f3 0f 1e fb          	endbr32 
  801e24:	55                   	push   %ebp
  801e25:	57                   	push   %edi
  801e26:	56                   	push   %esi
  801e27:	53                   	push   %ebx
  801e28:	83 ec 1c             	sub    $0x1c,%esp
  801e2b:	8b 44 24 3c          	mov    0x3c(%esp),%eax
  801e2f:	8b 74 24 30          	mov    0x30(%esp),%esi
  801e33:	8b 5c 24 34          	mov    0x34(%esp),%ebx
  801e37:	8b 7c 24 38          	mov    0x38(%esp),%edi
  801e3b:	85 c0                	test   %eax,%eax
  801e3d:	75 19                	jne    801e58 <__umoddi3+0x38>
  801e3f:	39 df                	cmp    %ebx,%edi
  801e41:	76 5d                	jbe    801ea0 <__umoddi3+0x80>
  801e43:	89 f0                	mov    %esi,%eax
  801e45:	89 da                	mov    %ebx,%edx
  801e47:	f7 f7                	div    %edi
  801e49:	89 d0                	mov    %edx,%eax
  801e4b:	31 d2                	xor    %edx,%edx
  801e4d:	83 c4 1c             	add    $0x1c,%esp
  801e50:	5b                   	pop    %ebx
  801e51:	5e                   	pop    %esi
  801e52:	5f                   	pop    %edi
  801e53:	5d                   	pop    %ebp
  801e54:	c3                   	ret    
  801e55:	8d 76 00             	lea    0x0(%esi),%esi
  801e58:	89 f2                	mov    %esi,%edx
  801e5a:	39 d8                	cmp    %ebx,%eax
  801e5c:	76 12                	jbe    801e70 <__umoddi3+0x50>
  801e5e:	89 f0                	mov    %esi,%eax
  801e60:	89 da                	mov    %ebx,%edx
  801e62:	83 c4 1c             	add    $0x1c,%esp
  801e65:	5b                   	pop    %ebx
  801e66:	5e                   	pop    %esi
  801e67:	5f                   	pop    %edi
  801e68:	5d                   	pop    %ebp
  801e69:	c3                   	ret    
  801e6a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  801e70:	0f bd e8             	bsr    %eax,%ebp
  801e73:	83 f5 1f             	xor    $0x1f,%ebp
  801e76:	75 50                	jne    801ec8 <__umoddi3+0xa8>
  801e78:	39 d8                	cmp    %ebx,%eax
  801e7a:	0f 82 e0 00 00 00    	jb     801f60 <__umoddi3+0x140>
  801e80:	89 d9                	mov    %ebx,%ecx
  801e82:	39 f7                	cmp    %esi,%edi
  801e84:	0f 86 d6 00 00 00    	jbe    801f60 <__umoddi3+0x140>
  801e8a:	89 d0                	mov    %edx,%eax
  801e8c:	89 ca                	mov    %ecx,%edx
  801e8e:	83 c4 1c             	add    $0x1c,%esp
  801e91:	5b                   	pop    %ebx
  801e92:	5e                   	pop    %esi
  801e93:	5f                   	pop    %edi
  801e94:	5d                   	pop    %ebp
  801e95:	c3                   	ret    
  801e96:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801e9d:	8d 76 00             	lea    0x0(%esi),%esi
  801ea0:	89 fd                	mov    %edi,%ebp
  801ea2:	85 ff                	test   %edi,%edi
  801ea4:	75 0b                	jne    801eb1 <__umoddi3+0x91>
  801ea6:	b8 01 00 00 00       	mov    $0x1,%eax
  801eab:	31 d2                	xor    %edx,%edx
  801ead:	f7 f7                	div    %edi
  801eaf:	89 c5                	mov    %eax,%ebp
  801eb1:	89 d8                	mov    %ebx,%eax
  801eb3:	31 d2                	xor    %edx,%edx
  801eb5:	f7 f5                	div    %ebp
  801eb7:	89 f0                	mov    %esi,%eax
  801eb9:	f7 f5                	div    %ebp
  801ebb:	89 d0                	mov    %edx,%eax
  801ebd:	31 d2                	xor    %edx,%edx
  801ebf:	eb 8c                	jmp    801e4d <__umoddi3+0x2d>
  801ec1:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801ec8:	89 e9                	mov    %ebp,%ecx
  801eca:	ba 20 00 00 00       	mov    $0x20,%edx
  801ecf:	29 ea                	sub    %ebp,%edx
  801ed1:	d3 e0                	shl    %cl,%eax
  801ed3:	89 44 24 08          	mov    %eax,0x8(%esp)
  801ed7:	89 d1                	mov    %edx,%ecx
  801ed9:	89 f8                	mov    %edi,%eax
  801edb:	d3 e8                	shr    %cl,%eax
  801edd:	8b 4c 24 08          	mov    0x8(%esp),%ecx
  801ee1:	89 54 24 04          	mov    %edx,0x4(%esp)
  801ee5:	8b 54 24 04          	mov    0x4(%esp),%edx
  801ee9:	09 c1                	or     %eax,%ecx
  801eeb:	89 d8                	mov    %ebx,%eax
  801eed:	89 4c 24 08          	mov    %ecx,0x8(%esp)
  801ef1:	89 e9                	mov    %ebp,%ecx
  801ef3:	d3 e7                	shl    %cl,%edi
  801ef5:	89 d1                	mov    %edx,%ecx
  801ef7:	d3 e8                	shr    %cl,%eax
  801ef9:	89 e9                	mov    %ebp,%ecx
  801efb:	89 7c 24 0c          	mov    %edi,0xc(%esp)
  801eff:	d3 e3                	shl    %cl,%ebx
  801f01:	89 c7                	mov    %eax,%edi
  801f03:	89 d1                	mov    %edx,%ecx
  801f05:	89 f0                	mov    %esi,%eax
  801f07:	d3 e8                	shr    %cl,%eax
  801f09:	89 e9                	mov    %ebp,%ecx
  801f0b:	89 fa                	mov    %edi,%edx
  801f0d:	d3 e6                	shl    %cl,%esi
  801f0f:	09 d8                	or     %ebx,%eax
  801f11:	f7 74 24 08          	divl   0x8(%esp)
  801f15:	89 d1                	mov    %edx,%ecx
  801f17:	89 f3                	mov    %esi,%ebx
  801f19:	f7 64 24 0c          	mull   0xc(%esp)
  801f1d:	89 c6                	mov    %eax,%esi
  801f1f:	89 d7                	mov    %edx,%edi
  801f21:	39 d1                	cmp    %edx,%ecx
  801f23:	72 06                	jb     801f2b <__umoddi3+0x10b>
  801f25:	75 10                	jne    801f37 <__umoddi3+0x117>
  801f27:	39 c3                	cmp    %eax,%ebx
  801f29:	73 0c                	jae    801f37 <__umoddi3+0x117>
  801f2b:	2b 44 24 0c          	sub    0xc(%esp),%eax
  801f2f:	1b 54 24 08          	sbb    0x8(%esp),%edx
  801f33:	89 d7                	mov    %edx,%edi
  801f35:	89 c6                	mov    %eax,%esi
  801f37:	89 ca                	mov    %ecx,%edx
  801f39:	0f b6 4c 24 04       	movzbl 0x4(%esp),%ecx
  801f3e:	29 f3                	sub    %esi,%ebx
  801f40:	19 fa                	sbb    %edi,%edx
  801f42:	89 d0                	mov    %edx,%eax
  801f44:	d3 e0                	shl    %cl,%eax
  801f46:	89 e9                	mov    %ebp,%ecx
  801f48:	d3 eb                	shr    %cl,%ebx
  801f4a:	d3 ea                	shr    %cl,%edx
  801f4c:	09 d8                	or     %ebx,%eax
  801f4e:	83 c4 1c             	add    $0x1c,%esp
  801f51:	5b                   	pop    %ebx
  801f52:	5e                   	pop    %esi
  801f53:	5f                   	pop    %edi
  801f54:	5d                   	pop    %ebp
  801f55:	c3                   	ret    
  801f56:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801f5d:	8d 76 00             	lea    0x0(%esi),%esi
  801f60:	29 fe                	sub    %edi,%esi
  801f62:	19 c3                	sbb    %eax,%ebx
  801f64:	89 f2                	mov    %esi,%edx
  801f66:	89 d9                	mov    %ebx,%ecx
  801f68:	e9 1d ff ff ff       	jmp    801e8a <__umoddi3+0x6a>
